Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

tscounters implements time series counters based on opentsdb. The key contribution of this library is to aggregate the counter submission to opentsdb to avoid high QPS to the counter server.

Example Code

The following is an example of how to use tscounters:

import tscounters
import time
import random


tscounters.init()
tscounters.add_counter_engine(
    tscounters.OpenTSDBCounterEngine(
        hostname="opentsdb-server-hostname"
    )
)

counter = tscounters.SimpleCounter(
    name="counter-name",
    aggregator=tscounters.SumAggregator(),
)

while True:
    counter.set(random.randint(0, 9), {"tag1": "1", "tag2": "2"})
    time.sleep(0.1)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages