-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes it easier to troubleshoot problems with the metrics pipeline, by visualizing what metrics are emitted. Fix the existing go_version and stats_version reporter to ensure that they work even if metrics are reported with ReportAt instead of Incr, Set, Observe etc.
- Loading branch information
1 parent
ef9539a
commit a11a2f8
Showing
7 changed files
with
284 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package stats_test | ||
|
||
import ( | ||
"os" | ||
|
||
stats "github.com/segmentio/stats/v5" | ||
"github.com/segmentio/stats/v5/stdoutstats" | ||
) | ||
|
||
func Example() { | ||
handler := &stdoutstats.Client{Dst: os.Stdout} | ||
engine := stats.NewEngine("engine-name", handler) | ||
// Will print: | ||
// | ||
// 2024-12-18T14:53:57-08:00 engine-name.server.start:1|c | ||
// | ||
// to the console. | ||
engine.Incr("server.start") | ||
engine.Flush() | ||
} |
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
Oops, something went wrong.