Skip to content

enrich/cube-metrics-net

Repository files navigation

cube-metrics-net

Vb.net collector/emitter for mbostock's cube metrics.

It's as simple as possible:

The collector can receive events, or measure the duration of actions, and it can also probe observable measures periodically.

There are a few emitters to choose from; the default stack of decorators includes buffering and retrying.

Installation

Fork and add as a submodule. Add the cube-metrics-net-src project to your solution.

Usage

Measure the duration of actions:

Dim cubehost As String = "http://your.cube.server:1080"
Dim cc As New CubeCollector.Factory(cubehost).getCubeCollector(),
Dim dd As New CubeData From {{"key", "value"}}
cc.Record(type, dd, Sub() SomeAction())

Measure things periodically:

Class MyMeasure
    Implements CubeCollector.Measure

    Public Function value() As List(Of CubeEvent) Implements CubeCollector.Measure.value
        dim ev as New CubeEvent("foo", Now(), Nothing, Nothing)
        Return New List(Of CubeEvent)({ev})
    End Function
End Class

Dim obs as new MyMeasure()
cc.RegisterMeasure(obs)

The measure specifies the time, in order to report things that happened in the past.

There's no collector injection mechanism, or singleton; use whichever method you prefer.

Feedback

If you use this code, please let me know! If anything was confusing or broken, please let me know!

Contributing

Feedback, suggestions, code reviews, pull requests, are all welcome.

License

Apache 2.0

Dependencies

Includes Json.NET (MIT license) and Nlog (BSD license)

About

vb.net collector/emitter for mbostock's cube metrics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published