cmd/syncthing: Start CPU usage monitoring not from init (fixes #4183)

Starting stuff from init() is an antipattern, and the innerProcess
variable isn't 100% reliable. We should sort out the other uses of it as
well in due time.

Also removing the hack on innerProcess as I happened to see it and the
affected versions are now <1% users.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4185
This commit is contained in:
Jakob Borg
2017-05-31 18:14:04 +00:00
committed by Audrius Butkevicius
parent b49bbe82dd
commit 803da92ca9
5 changed files with 88 additions and 59 deletions

View File

@@ -0,0 +1,13 @@
// Copyright (C) 2017 The Syncthing Authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
package main
type mockedCPUService struct{}
func (*mockedCPUService) Rate() float64 {
return 42
}