Created
November 24, 2014 05:02
-
-
Save tamsky/bad8a7968560f133450d to your computer and use it in GitHub Desktop.
pyKairosdb in juypter colaboratory
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
%matplotlib inline | |
# working example | |
%install_ext https://bitbucket.org/birkenfeld/ipython-physics/raw/d1310a2ab15d/physics.py | |
%load_ext physics | |
# try something similar | |
%install_ext https://github.com/tamsky/pyKairosDB/raw/master/pyKairosDB.zip | |
sys.path.append(".ipython/extensions/pyKairosDB.zip") | |
import pyKairosDB | |
from pyKairosDB import util as util | |
import matplotlib.pyplot as plt | |
connection = pyKairosDB.connect("example.com") | |
print pyKairosDB.metadata.get_all_metric_names(connection) | |
content = connection.read_relative( ['kairosdb.protocol.http_request_count'], (4, 'hours')) | |
print util.get_content_values_by_name(content, 'kairosdb.protocol.http_request_count')[0]['values'] | |
plt.plot(util.get_content_values_by_name(content, 'kairosdb.protocol.http_request_count')[0]['values']) | |
plt.title('something'); | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment