-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #519 from mackerelio/loadavg-1-5-15
add loadavg1 and loadavg15
- Loading branch information
Showing
7 changed files
with
42 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// +build !windows | ||
|
||
package metrics | ||
|
||
import ( | ||
"github.com/mackerelio/go-osstat/loadavg" | ||
"github.com/mackerelio/golib/logging" | ||
) | ||
|
||
// loadavg | ||
// - loadavg1: load average per 1 minutes | ||
// - loadavg5: load average per 5 minutes | ||
// - loadavg15: load average per 15 minutes | ||
|
||
// LoadavgGenerator generates load average values | ||
type LoadavgGenerator struct { | ||
} | ||
|
||
var loadavgLogger = logging.GetLogger("metrics.loadavg") | ||
|
||
// Generate load averages | ||
func (g *LoadavgGenerator) Generate() (Values, error) { | ||
loadavgs, err := loadavg.Get() | ||
if err != nil { | ||
loadavgLogger.Errorf("%s", err) | ||
return nil, err | ||
} | ||
return Values{ | ||
"loadavg1": loadavgs.Loadavg1, | ||
"loadavg5": loadavgs.Loadavg5, | ||
"loadavg15": loadavgs.Loadavg15, | ||
}, nil | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters