Documentation ¶
Index ¶
- func InsertField(bucket, fieldName string) string
- func SerializeBucketName(measurement string, tags map[string]string, template string, prefix string) string
- func SerializeBucketNameWithTags(measurement string, tags map[string]string, prefix string, separator string, ...) string
- type Serializer
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InsertField ¶
InsertField takes the bucket string from SerializeBucketName and replaces the FIELDNAME portion. If fieldName == "value", it will simply delete the FIELDNAME portion.
func SerializeBucketName ¶
func SerializeBucketName( measurement string, tags map[string]string, template string, prefix string, ) string
SerializeBucketName will take the given measurement name and tags and produce a graphite bucket. It will use the GraphiteSerializer.Template to generate this, or DEFAULT_TEMPLATE.
NOTE: SerializeBucketName replaces the "field" portion of the template with FIELDNAME. It is up to the user to replace this. This is so that SerializeBucketName can be called just once per measurement, rather than once per field. See GraphiteSerializer.InsertField() function.
func SerializeBucketNameWithTags ¶
func SerializeBucketNameWithTags( measurement string, tags map[string]string, prefix string, separator string, field string, ) string
SerializeBucketNameWithTags will take the given measurement name and tags and produce a graphite bucket. It will use the Graphite11Serializer. http://graphite.readthedocs.io/en/latest/tags.html
Types ¶
type Serializer ¶ added in v0.0.12
type Serializer struct { Prefix string Template string TagSupport bool Separator string Templates []*Template }
func (*Serializer) Serialize ¶ added in v0.0.12
func (s *Serializer) Serialize(metric cua.Metric) ([]byte, error)
func (*Serializer) SerializeBatch ¶ added in v0.0.12
func (s *Serializer) SerializeBatch(metrics []cua.Metric) ([]byte, error)