<commit_before>#!/usr/bin/env python

import json
import toolbox
from cronenberg.model import *
from cronenberg.data import Queries
from cronenberg.cask.storage import EntityEncoder
from toolbox.graphite.functions import *

q = Queries(toolbox.PROD)

dash = Dashboard(name='Automation Overview',
                 queries={ 'api-rate' : str(q.automation_api_rates()),
                           'api-latency' : str(q.automation_api_latency()) },
                 grid=Grid(rows=[
                     [ GridEntry(span=3, presentation=SingleStatPresentation(title='Raw Events Processed',
                                                                             query_name='api-rate',
                                                                             transform='sum')),
                       GridEntry(span=9, presentation=ChartPresentation(title="Foos",
                                                                        query_name="api-latency",
                                                                        chart_type='timeseries')) ]
                 ]))

#print dash.queries['api-rate']


print json.dumps(dash, cls=EntityEncoder, indent=4)
#print json.dumps(target, cls=EntityEncoder, indent=4)

#print vars(target)
#print dir(target)

#print str(target)
#print vars(target)

#print json.dumps(dash.to_json(), indent=4, sort_keys=True)

#print group(1,1).to_json()<commit_msg>Dump the demo dashboard<commit_after>#!/usr/bin/env python

import json
import toolbox
from cronenberg.model import *
from cronenberg.data import Queries
from cronenberg.cask.storage import EntityEncoder
from toolbox.graphite.functions import *
from cronenberg.application import demo_dashboard

q = Queries(toolbox.PROD)

dash = demo_dashboard('-3h', None)

print json.dumps(dash, cls=EntityEncoder, indent=4)
#print json.dumps(target, cls=EntityEncoder, indent=4)

#print vars(target)
#print dir(target)

#print str(target)
#print vars(target)

#print json.dumps(dash.to_json(), indent=4, sort_keys=True)

#print group(1,1).to_json()
{'fraction_non_alphanumeric': 0.10855745721271394, 'fraction_numerical': 0.006356968215158924, 'mean_word_length': 2.3540983606557377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '839078', 'n_tokens_mistral': 573, 'n_tokens_neox': 562, 'n_words': 118}