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
| [pid 20882] 00:30:24.285647 select(0, NULL, NULL, NULL, {0, 32000}) = 0 (Timeout) [13/1966] | |
| [pid 20882] 00:30:24.318000 select(0, NULL, NULL, NULL, {0, 35094} <unfinished ...> | |
| [pid 20881] 00:30:24.346571 <... select resumed> ) = 0 (Timeout) | |
| [pid 20881] 00:30:24.346657 clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 64916351}) = 0 | |
| [pid 20881] 00:30:24.346800 clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {0, 65008346}) = 0 | |
| [pid 20881] 00:30:24.346868 writev(1, [{"0.00009", 7}, {"\n", 1}], 2) = 8 | |
| [pid 20881] 00:30:24.346932 select(0, NULL, NULL, NULL, {1, 0} <unfinished ...> | |
| [pid 20882] 00:30:24.353243 <... select resumed> ) = 0 (Timeout) | |
| [pid 20882] 00:30:24.353391 poll([{fd=3, events=POLLOUT}], 1, 1000) = 1 ([{fd=3, revents=POLLOUT}]) | |
| [pid 20882] 00:30:24.353434 sendto(3, "\0\0\0c\200\2]q\1(U\26py.graphiti.random.intq\2GA\325\256\356\200\0260\333K\20\206\206q\3U\30py.graphiti. |
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
| stator time() [real time]: 0.00030 0.00010 0.00009 0.00010 0.00008 | |
| stator clock() [CPU time]: 0.00031 0.00012 0.00013 0.00013 0.00013 | |
| graphiti time() [real time]: 0.00119 0.00006 0.00005 0.00006 0.00005 | |
| graphiti clock() [CPU time]: 0.00191 0.00006 0.00007 0.00006 0.00006 |
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
| from time import time, clock | |
| # .. later | |
| start = time() # clock() | |
| carbon.add("py.stator.random.int", v1) | |
| carbon.add("py.stator.random.float", v2) | |
| end = time() # clock() | |
| print(format(end - start, '0.5f')) |
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: |
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
| import random | |
| from time import sleep | |
| from stator import carbon | |
| def main(): | |
| carbon.init_env() | |
| while True: | |
| v1 = random.randrange(10, 100) | |
| v2 = random.randrange(100, 1000)/10.0 | |
| carbon.add("py.stator.random.int", v1) |
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
| id = carbon_connect_ipv4((127 << 24) | (0 << 16) | (0 << 8) | (1 << 0), 2003) | |
| # then somewhere else | |
| carbon_add_i64(id, "metric.name1", len("metric.name1"), 1) |
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
| with sink as sender: | |
| sender.add_value("metric.name1", value=1) | |
| sender.add_value("metric.name2", value=2.5) | |
| sender.add_value("{prefix}.value".format(prefix="mymetrics"), value=2.5) | |
| sender.add_value("server.{}.value", servername, value=12) |
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
| { | |
| let mut sender = sink.sender(); | |
| sender.add_value("metric.name1", 1); | |
| sender.add_value("metric.name2", 2.5); | |
| sender.add_value(format!("{prefix}.value", prefix="mymetrics"), 2.5); | |
| sender.add_value(format_args!("server.{}.value", servername), 12u32); | |
| } |
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
| let sink = loop_creator.add_and_fetch(identity, |scope| { | |
| connect_ip(addr, scope) | |
| }).unwrap(); |
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
| ./httpserver/samples/echo/echo_server -http_port 3000 -ip 127.0.0.1 -threads 1 | |
| proxygen a994f4a6f | |
| > wrk -c 100 -d 60 -t2 http://localhost:3000 | |
| Running 1m test @ http://localhost:3000 | |
| 2 threads and 100 connections | |
| Thread Stats Avg Stdev Max +/- Stdev | |
| Latency 3.53ms 588.05us 23.71ms 94.84% | |
| Req/Sec 14.28k 1.36k 16.88k 56.67% | |
| 1706482 requests in 1.00m, 182.27MB read | |
| Requests/sec: 28423.86 |