fn: stats view/distribution improvements (#1154)

* fn: stats view/distribution improvements

*) View latency distribution is now an argument
in view creation functions. This allows easier
override to set custom buckets. It is simplistic
and assumes all latency views would use the same
set, but in practice this is already the case.
*) Removed API view creation to main, this should not
be enabled for all node types. This is consistent with
the rest of the system.

* fn: Docker samples of cpu/mem/disk with specific buckets
This commit is contained in:
Tolga Ceylan
2018-08-03 11:06:54 -07:00
committed by GitHub
parent 19b39b7601
commit 0105f8321e
10 changed files with 168 additions and 238 deletions

View File

@@ -27,13 +27,20 @@ func main() {
func registerViews() {
// Register views in agent package
keys := []string{"fn_appname", "fn_path"}
agent.RegisterAgentViews(keys)
agent.RegisterDockerViews(keys)
agent.RegisterContainerViews(keys)
dist := []float64{1, 10, 50, 100, 250, 500, 1000, 10000, 60000, 120000}
agent.RegisterAgentViews(keys, dist)
agent.RegisterDockerViews(keys, dist)
agent.RegisterContainerViews(keys, dist)
// Register docker client views
docker.RegisterViews(keys)
docker.RegisterViews(keys, dist)
// Register s3 log views
s3.RegisterViews(keys)
s3.RegisterViews(keys, dist)
apiKeys := []string{"path", "method", "status"}
apiDist := []float64{0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000}
server.RegisterAPIViews(apiKeys, apiDist)
}