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
import cradox as rados | |
POOL_NAME = "gnocchi-test" | |
CONFFILE = "" | |
USERNAME = "" | |
OBJECT_NAME = "myomapobject" | |
ITER = 100 | |
# options['keyring'] = conf.ceph_keyring | |
# options['key'] = conf.ceph_secret |
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
➔ gnocchi metric create -a high | |
+------------------------------------+-------------------------------------------------------------------+ | |
| Field | Value | | |
+------------------------------------+-------------------------------------------------------------------+ | |
| archive_policy/aggregation_methods | std, count, 95pct, min, max, sum, median, mean | | |
| archive_policy/back_window | 0 | | |
| archive_policy/definition | - points: 3600, granularity: 0:00:01, timespan: 1:00:00 | | |
| | - points: 10080, granularity: 0:01:00, timespan: 7 days, 0:00:00 | | |
| | - points: 8760, granularity: 1:00:00, timespan: 365 days, 0:00:00 | | |
| archive_policy/name | high | |
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
#!/usr/bin/env python | |
import uuid | |
import logging | |
import os | |
import random | |
import sys | |
from keystoneauth1.identity import v3 | |
from keystoneauth1 import session | |
from keystoneclient.v3 import client as ks |
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
def count_lead_and_trail_zeroes(d): | |
"""Count the number of leading and trailing zeroes in an integer.""" | |
b = "{:064b}".format(d) | |
try: | |
return as_str.index("1"), 63 - as_str.rindex("1") | |
except ValueError: | |
return 64, 64 | |
def count_lead_and_trail_zeroes(d): | |
# https://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightLinear |
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
import math | |
import time | |
import random | |
import pandas | |
import datetime | |
from gnocchi import carbonara | |
points = 14400 | |
sampling = 5 | |
compress_times = 10 |
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
def create_engine(sql_connection, sqlite_fk=False, | |
mysql_traditional_mode=False): | |
return session.create_engine(sql_connection, | |
sqlite_fk, | |
mysql_traditional_mode, | |
idle_timeout=CONF.database.idle_timeout, | |
connection_debug=CONF.databse.connection_debug, | |
max_pool_size=CONF.database.max_pool_size, | |
max_overflow=CONF.database.max_overflow, | |
pool_timeout=CONF.database.pool_timeout, |
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
=> GET /v2/meter/instances/statistics?reset_on=metadata.vm_state | |
<= { | |
'off': [ { avg: ... max: ... start: '2013-07-01 00:00:00', end: '2013-07-01 00:59:59' }, | |
{ avg: ... max: ... start: '2013-07-01 03:00:00', end: '2013-07-01 03:59:59' }, | |
'on': [ { avg: ... max: ... start: '2013-07-01 01:00:00', end: '2013-07-01 01:59:59' } ], | |
'suspended': [ { avg: ... max: ... start: '2013-07-01 02:00:00', end: '2013-07-01 02:59:59' } ] | |
} |
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
% git diff | |
diff --git a/ceilometer/storage/impl_mongodb.py b/ceilometer/storage/impl_mongodb.py | |
index 4580833..84bd8fc 100644 | |
--- a/ceilometer/storage/impl_mongodb.py | |
+++ b/ceilometer/storage/impl_mongodb.py | |
@@ -288,6 +288,8 @@ class Connection(base.Connection): | |
self.db.clear() | |
else: | |
self.conn.drop_database(self.db) | |
+ import time |
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
(if (if 1 2) 1) | |
Generates the tree | |
ast.stmt.If | |
`-> ast.stmt.If | |
`-> ast.expr.Num | |
`-> ast.expr.Num | |
`-> ast.expr.Num |
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
diff --git a/hy/compiler.py b/hy/compiler.py | |
index 24ba107..22687ca 100644 | |
--- a/hy/compiler.py | |
+++ b/hy/compiler.py | |
@@ -157,6 +157,19 @@ class HyASTCompiler(object): | |
return self._mangle_branch([branch]) | |
@builds("if") | |
+ def wraps_if_expression(self, expr): | |
+ return ast.Expr( |