Skip to content

Instantly share code, notes, and snippets.

@mayhem
Last active February 18, 2020 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayhem/77818163cc3469f17e578380e8f5fb1b to your computer and use it in GitHub Desktop.
Save mayhem/77818163cc3469f17e578380e8f5fb1b to your computer and use it in GitHub Desktop.
https://github.com/metabrainz/listenbrainz-server/blob/master/listenbrainz/influx_writer/influx_writer.py#L41
the callback function has three major parts: parse json, write data to influx, collect stats. The only
thing that takes time is the write, which is measured in a few ms. The writer is actually reasonably speedy!
It seems to not get called more often from rabbitmq!
2020-02-18 09:52:46,864 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:46,865 INFO parse: 0.000 write: 0.009 stats: 0.000
2020-02-18 09:52:48,197 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:48,198 INFO parse: 0.000 write: 0.009 stats: 0.000
2020-02-18 09:52:49,552 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:49,552 INFO parse: 0.000 write: 0.003 stats: 0.000
2020-02-18 09:52:50,773 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:50,773 INFO parse: 0.000 write: 0.004 stats: 0.000
2020-02-18 09:52:51,833 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:51,833 INFO parse: 0.000 write: 0.004 stats: 0.000
2020-02-18 09:52:53,175 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:53,175 INFO parse: 0.000 write: 0.004 stats: 0.000
2020-02-18 09:52:54,457 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:54,457 INFO parse: 0.000 write: 0.004 stats: 0.000
2020-02-18 09:52:55,813 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:55,813 INFO parse: 0.000 write: 0.007 stats: 0.000
2020-02-18 09:52:57,247 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:57,247 INFO parse: 0.000 write: 0.013 stats: 0.000
2020-02-18 09:52:58,630 INFO dups: 3, unique: 0, submitted: 0
2020-02-18 09:52:58,631 INFO parse: 0.000 write: 0.004 stats: 0.000
2020-02-18 09:52:59,915 INFO dups: 0, unique: 1, submitted: 1
2020-02-18 09:52:59,916 INFO parse: 0.000 write: 0.027 stats: 0.000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment