Skip to content

Commit

Permalink
examples: add simple
Browse files Browse the repository at this point in the history
  • Loading branch information
suyash committed Jun 23, 2016
1 parent f04985e commit 6a0eeef
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/simple.go
@@ -0,0 +1,25 @@
package main

import "github.com/performancecopilot/speed"

func main() {
metric := speed.NewPCPMetric(
int32(42),
"simple.counter",
nil,
speed.Int32Type,
speed.CounterSemantics,
speed.MetricUnit(speed.OneUnit),
"",
"",
)

writer, err := speed.NewPCPWriter("simple", speed.ProcessFlag)
if err != nil {
panic(err)
}

writer.Registry().AddMetric(metric)

writer.Start()
}

0 comments on commit 6a0eeef

Please sign in to comment.