Created
October 5, 2016 06:34
-
-
Save boris-42/122993c8e707b08f811d12d541c2bb4f to your computer and use it in GitHub Desktop.
graphite_transf.py
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
SLA = 5 | |
FAILED = [] | |
make_positive(ts): | |
return [t, 1 for t, v in ts]: | |
for v in time_series: | |
if v: | |
if len(FAILED) <= SLA: | |
send_to_graphite(make_positive(FAILED) + [v]) | |
FAILED = [] | |
else: | |
send_to_graphite(FAILED + [v]) | |
FAILED = [] | |
else: | |
if len(FAILED) > SLA: | |
send_to_graphite([FAILED.pop(0)]) | |
FAILED.append(v) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment