Created
February 10, 2016 22:05
-
-
Save tailhook/1741a60471474c56f9ba to your computer and use it in GitHub Desktop.
This file contains hidden or 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 is an pure-python alternative to stator's carbon implementation | |
| import os | |
| import random | |
| from time import sleep, time, clock | |
| from graphiti.client import Client | |
| def main(): | |
| carbon = Client(os.environ['CARBON_HOST']) | |
| while True: | |
| v1 = random.randrange(10, 100) | |
| v2 = random.randrange(100, 1000)/10.0 | |
| carbon.send("py.graphiti.random.int", v1) | |
| carbon.send("py.graphiti.random.float", v2) | |
| sleep(1) | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment