目标:
弄清楚聚合算法原理
目录:
1 总入口
2 分析MetricProcessor服务
3 分析监控数据聚合处理算法_compute_and_store_timeseries方法
4 分析 _get_unaggregated_timeserie_and_unserialize: 获取未聚合的时间序列数据进行反序列化,来重新构建为新的时间序列
5 分析 ts.set_values: 计算聚合后的时间序列
6 分析_store_unaggregated_timeserie: 更新未聚合的时间序列
7 总结
1 总入口
gnocchi/cli.py
主入口代码如下:
def metricd():
conf = cfg.ConfigOpts()
conf.register_cli_opts([
cfg.IntOpt("stop-after-processing-metrics",
default=0,
min=0,
help="Number of metrics to process without workers, "
"for testing purpose"),
])
conf = service.prepare_service(conf=conf)
if conf.stop_after_processing_metrics:
metricd_tester(conf)
else:
MetricdServiceManager(conf).run()
分析:
1.1) 这里最关键的代码就是
MetricdServiceManager(conf).run()
进入到对应代码如下
class MetricdServiceManager(cotyledon.ServiceManager):
def __init__(self, conf):
super(MetricdServiceManager, self).__init__()
oslo_config_glue.setup(self, conf)
self.conf = conf
self.queue = multiprocessing.Manager().Queue()
self.add(MetricScheduler, args=(self.conf, self.queue))
self.metric_processor_id = self.add(
MetricProcessor, args=(self.conf, self.queue),
workers=conf.metricd.workers)
if self.conf.metricd.metric_reporting_delay >= 0:
self.add(MetricReporting, args=(self.conf,))
self.add(MetricJanitor, args=(self.conf,))
self.register_hooks(on_reload=self.on_reload)
def run(self):
super(MetricdServiceManager, self).run()
self.queue.close()
分析:
1.1.1) 可以看到这里分别实例化了
MetricScheduler服务用于每隔一定时间从incoming数据库中拉取临时的监控数据,放在多进程队列中
MetricReporting服务每隔2分钟统计并以日志形式输出未处理的监控项个数和未处理的measure数目
MetricJanitor每隔已定时间清理已经删除的metric数据
以及最重要的监控数据聚合处理服务MetricProcessor,它从MetricScheduler服务存放在多进程队列中获取需要处理的监控数据进行最终的聚合运算。
1.1.2)下面重点分析MetricProcessor服务。
具体参见2的分析
2 分析MetricProcessor服务
代码位置: gnocchi/cli.py
内容如下:
class MetricProcessor(MetricProcessBase):
name = "processing"
def __init__(self, worker_id, conf, queue):
super(MetricProcessor, self).__init__(worker_id, conf, 0)
self.queue = queue
def _run_job(self):
try:
try:
metrics = self.queue.get(block=True, timeout=10)
except six.moves.queue.Empty:
# NOTE(sileht): Allow the process to exit gracefully every
# 10 seconds
return
self.store.process_background_tasks(self.index, metrics)
except Exception:
LOG.error("Unexpected error during measures processing",
exc_info=True)
分析:
2.1) _run_job的主要逻辑就是从存放监控数据的多进程队列中获取
监控数据,然后调用self.store实际就是storage数据库(这里一般使用ceph)
的process_background_tasks方法
2.2) 分析process_background_tasks方法
进入到
gnocchi/storage/__init__.py
如下代码:
class StorageDriver(object):
def __init__(self, conf, incoming):
self.incoming = incoming
def process_background_tasks(self, index, metrics, sync=False):
"""Process background tasks for this storage.
This calls :func:`process_new_measures` to process new measures
:param index: An indexer to be used for querying metrics
:param block_size: number of metrics to process
:param sync: If True, then process everything synchronously and raise
on error
:type sync: bool
"""
LOG.debug("Processing new measures")
try:
self.process_new_measures(index, metrics, sync)
except Exception:
if sync:
raise
LOG.error("Unexpected error during measures processing",
exc_info=True)
分析:
2.2.1) 最关键的就是调用process_new_measures方法进行处理,
进入到,具体参见2.3的分析
2.3 分析process_new_measures方法
gnocchi/storage/_carbonara.py
代码如下:
class CarbonaraBasedStorage(storage.StorageDriver):
def process_new_measures(self, indexer, metrics_to_process,
sync=False):
metrics = indexer.list_metrics(ids=metrics_to_process)
# This build the list of deleted metrics, i.e. the metrics we have
# measures to process for but that are not in the indexer anymore.
deleted_metrics_id = (set(map(uuid.UUID, metrics_to_process))
- set(m.id for m in metrics))
for metric_id in deleted_metrics_id:
# NOTE(jd): We need to lock the metric otherwise we might delete
# measures that another worker might be processing. Deleting
# measurement files under its feet is not nice!
try:
with self._lock(metric_id)(blocking=sync):
self.incoming.delete_unprocessed_measures_for_metric_id(
metric_id)
except coordination.LockAcquireFailed:
LOG.debug("Cannot acquire lock for metric %s, postponing "
"unprocessed measures deletion", metric_id)
for metric in metrics:
lock = self._lock(metric.id)
# Do not block if we cannot acquire the lock, that means some other
# worker is doing the job. We'll just ignore this metric and may
# get back later to it if needed.
if not lock.acquire(blocking=sync):
continue
try:
locksw = timeutils.StopWatch().start()
LOG.debug("Processing measures for %s", metric)
# process_measure_for_metric(self, metric):返回待处理监控项对应的监控数据列表,
# 每个元素是时间戳和对应的值,样例:[(Timestamp('2018-04-19 02:29:04.925214'), 4.785732057729687)]
with self.incoming.process_measure_for_metric(metric) \
as measures:
self._compute_and_store_timeseries(metric, measures)
LOG.debug("Metric %s locked during %.2f seconds",
metric.id, locksw.elapsed())
except Exception:
LOG.debug("Metric %s locked during %.2f seconds",
metric.id, locksw.elapsed())
if sync:
raise
LOG.error("Error processing new measures", exc_info=True)
finally:
lock.release()
分析:
2.3.1)具体处理过程如下:
一. 根据待处理的监控项集合,判断如果有已经删除的监控项,则删除对应incoming storage中的监控数据
二. 遍历待处理的监控项列表,获取每个监控项在incoming storage中的监控数据列表,然后根据监控项及其待处理监控数据
调用_compute_and_store_timeseries方法来计算并存储时间序列
具体步骤二需要具体细分为如下步骤
最关键的代码如下:
with self.incoming.process_measure_for_metric(metric) \
as measures:
self._compute_and_store_timeseries(metric, measures)
对_compute_and_store_timeseries方法的分析
具体参见3的分析
3 分析监控数据聚合处理算法_compute_and_store_timeseries方法
class CarbonaraBasedStorage(storage.StorageDriver):
def _compute_and_store_timeseries(self, metric, measures):
# NOTE(mnaser): The metric could have been handled by
# another worker, ignore if no measures.
if len(measures) == 0:
LOG.debug("Skipping %s (already processed)", metric)
return
measures = sorted(measures, key=operator.itemgetter(0))
agg_methods = list(metric.archive_policy.aggregation_methods)
block_size = metric.archive_policy.max_block_size
back_window = metric.archive_policy.back_window
definition = metric.archive_policy.definition
try:
ts = self._get_unaggregated_timeserie_and_unserialize(
metric, block_size=block_size, back_window=back_window)
except storage.MetricDoesNotExist:
try:
self._create_metric(metric)
except storage.MetricAlreadyExists:
# Created in the mean time, do not worry
pass
ts = None
except CorruptionError as e:
LOG.error(e)
ts = None
if ts is None:
# This is the first time we treat measures for this
# metric, or data are corrupted, create a new one
ts = carbonara.BoundTimeSerie(block_size=block_size,
back_window=back_window)
current_first_block_timestamp = None
else:
current_first_block_timestamp = ts.first_block_timestamp()
# NOTE(jd) This is Python where you need such
# hack to pass a variable around a closure,
# sorry.
computed_points = {"number": 0}
'''
_map_add_measures(bound_timeserie):
1. 对给定的已经合并了待处理数据生成的时间序列和未聚合的时间序列的合并时间序列boundTimeSerie进行如下操作
2. 遍历归档策略,根据采样间隔,聚合方法:
计算每个boundTimeSerie聚合后的时间序列;
并对该聚合的时间序列分割,计算分割序列的偏移量和对应序列化的值;
根据偏移量,将序列化的值写入到对应的ceph对象
总结:这个函数实现了: 计算聚合后的时间序列,将聚合后的时间序列写入到ceph对象中
'''
def _map_add_measures(bound_timeserie):
# NOTE (gordc): bound_timeserie is entire set of
# unaggregated measures matching largest
# granularity. the following takes only the points
# affected by new measures for specific granularity
tstamp = max(bound_timeserie.first, measures[0][0])
new_first_block_timestamp = bound_timeserie.first_block_timestamp()
computed_points['number'] = len(bound_timeserie)
for d in definition:
'''
group_serie(self, granularity, start=0):
1.根据给定的时间开始时间,计算过滤后的时间序列,按照采样间隔计算分组后的时间索引列表
2.对分组后的时间序列索引列表赋值,对时间序列的索引按照采样间隔做去重处理,得到新的索引列表和次数列表
'''
ts = bound_timeserie.group_serie(
d.granularity, carbonara.round_timestamp(
tstamp, d.granularity * 10e8))
'''
根据给定的聚合方法,归档策略等信息,以及已经分组的时间序列,计算聚合后的时间序列,
并将聚合后的时间序列写入到ceph的对象中
_add_measures(self, aggregation, archive_policy_def,
metric, grouped_serie,
previous_oldest_mutable_timestamp,
oldest_mutable_timestamp):
1. 根据给定的聚合方法,对已经索引分组的时间序列等先计算得到聚合后的时间序列
2. 对时间序列做截断操作,得到截断后的时间序列,最终用这些参数初始化AggregatedTimeSerie对象
3. 对已经计算好的时间序列进行分割(例如每个时间序列最多保存3600个点),对每个分割后的时间序列
计算写入到对象的偏移量值,以及对应序列化的值,然后写入ceph对象;
4. 重复步骤3,直到所有被分割的时间序列都写入到了ceph对象
'''
self._map_in_thread(
self._add_measures,
((aggregation, d, metric, ts,
current_first_block_timestamp,
new_first_block_timestamp)
for aggregation in agg_methods))
with timeutils.StopWatch() as sw:
'''
set_values(self, values, before_truncate_callback=None,
ignore_too_old_timestamps=False):
1. 从未聚合的时间序列最后一个时间lastTime为基点,找出能够被最大采样间隔(例如86400)整除且最接近lasTtime
的时间作为最近的起始时间firstTime
2. 然后从待处理监控数据列表中过滤出时间 >= firstTime的待处理监控数据
3. 将待处理的监控数据(有时间,值的元组组成的列表),构建为待处理时间序列,并检查
重复和是否是单调的,然后用原来未聚合的时间序列和当前待处理时间序列进行合并操作,
得到新生成的时间序列
'''
ts.set_values(measures,
before_truncate_callback=_map_add_measures,
ignore_too_old_timestamps=True)
elapsed = sw.elapsed()
number_of_operations = (len(agg_methods) * len(definition))
perf = ""
if elapsed > 0:
perf = " (%d points/s, %d measures/s)" % (
((number_of_operations * computed_points['number']) /
elapsed),
((number_of_operations * len(measures)) / elapsed)
)
LOG.debug("Computed new metric %s with %d new measures "
"in %.2f seconds%s",
metric.id, len(measures), elapsed, perf)
'''
BoundTimeSerie.serialize():
1. 对时间序列的索引进行numpy.diff的求差值操作,并
在所求的索引差值列表的最前面加上该时间序列的第一个值,
得到差值索引列表
2. 对差值索引列表的类型转换为uint64类型
3. 对时间序列的值列表类型转换为浮点型
4. 对差值索引列表转换为字节 + 对时间序列的值列表转换为字节,
得到字符串
5. 对该字符串调用lz4.dumps进行压缩,返回该压缩后的字符串
'''
'''
CephStorage._store_unaggregated_timeserie(self, metric, data, version=3)
构建类似gnocchi_01f0658b-f147-482b-bca9-f474a79320dc_none_v3的对象名称,向
该对象中写入未聚合的时间序列的压缩后的字符串
该字符串前半部分为:时间序列索引,后半部分为时间序列值
'''
self._store_unaggregated_timeserie(metric, ts.serialize())
分析:
3.0)变量分析
(Pdb) p metric
(Pdb) p metric.__dict__
{'status': u'active', '_sa_instance_state':
(Pdb) p type(metric)
(Pdb) p measures
[(Timestamp('2018-04-19 04:21:08.054995'), 4.799075611984741), (Timestamp('2018-04-19 05:10:10.429245'), 4.574397482330608), (Timestamp('2018-04-19 04:08:07.438367'), 4.597624310196946), (Timestamp('2018-04-18 11:31:30.479519'), 4.630697293574757), (Timestamp('2018-04-19 02:30:04.802941'), 4.72629831122347), (Timestamp('2018-04-19 02:05:04.802314'), 4.899465312822332), (Timestamp('2018-04-19 02:29:04.925214'), 4.785732057729687), (Timestamp('2018-04-19 03:50:07.328953'), 4.731680478480859), (Timestamp('2018-04-19 04:25:10.788649'), 4.646869894518424), (Timestamp('2018-04-19 01:31:57.004015'), 0.038519154635059005), (Timestamp('2018-04-19 05:07:07.455603'), 4.871081246415606), (Timestamp('2018-04-19 03:27:07.187010'), 4.676876763593233), (Timestamp('2018-04-19 03:06:07.265474'), 4.606219026908934), (Timestamp('2018-04-19 03:20:08.015457'), 5.077420524644917), (Timestamp('2018-04-19 04:17:08.635360'), 4.451037124258282), (Timestamp('2018-04-19 02:00:05.068829'), 4.985014177514147), (Timestamp('2018-04-19 04:37:07.545998'), 4.744643535515904), (Timestamp('2018-04-19 03:15:07.704887'), 4.545552252879761), (Timestamp('2018-04-19 02:09:04.734396'), 4.864783021566218), (Timestamp('2018-04-19 02:59:07.423876'), 4.762563821321215), (Timestamp('2018-04-19 02:39:07.148106'), 4.782045485846876), (Timestamp('2018-04-18 12:20:30.465645'), 4.44247276885732), (Timestamp('2018-04-18 12:42:31.045815'), 4.521539770784765), (Timestamp('2018-04-19 04:13:07.800664'), 4.595336208431523), (Timestamp('2018-04-19 04:30:08.522222'), 4.754737592470978), (Timestamp('2018-04-19 02:52:15.188803'), 4.164035307458439), (Timestamp('2018-04-19 01:42:04.879282'), 4.742942389783928), (Timestamp('2018-04-19 04:20:07.626691'), 4.850554014110979), (Timestamp('2018-04-19 04:34:07.500111'), 4.761731027385721), (Timestamp('2018-04-19 01:57:05.898123'), 4.716622350276037), (Timestamp('2018-04-18 11:43:30.481515'), 4.408241206936367), (Timestamp('2018-04-19 04:12:08.392606'), 4.772616189711427), (Timestamp('2018-04-18 12:33:30.688886'), 4.333678428076205), (Timestamp('2018-04-19 04:22:07.350868'), 4.738947009010222), (Timestamp('2018-04-19 02:51:05.544821'), 4.754449419185193), (Timestamp('2018-04-18 11:40:30.444856'), 4.682041465410015), (Timestamp('2018-04-19 03:53:07.993668'), 4.669766181342102), (Timestamp('2018-04-19 02:17:08.645818'), 4.869275081102868), (Timestamp('2018-04-19 04:44:08.798867'), 4.729204521780629), (Timestamp('2018-04-19 01:51:04.688511'), 4.692836268115815), (Timestamp('2018-04-19 01:34:04.961521'), 4.844135632016908), (Timestamp('2018-04-19 02:06:04.642609'), 4.779388203216579), (Timestamp('2018-04-19 03:01:07.438882'), 4.702765182102024), (Timestamp('2018-04-19 01:33:05.714625'), 4.775880629319837), (Timestamp('2018-04-18 12:34:31.000673'), 4.410414833173489), (Timestamp('2018-04-19 05:09:09.656214'), 4.622927607595337), (Timestamp('2018-04-19 03:39:07.385578'), 4.74858228391203), (Timestamp('2018-04-19 03:13:08.375850'), 4.648345083580437), (Timestamp('2018-04-19 04:07:07.842371'), 4.730370099716543), (Timestamp('2018-04-19 03:24:07.972809'), 4.657734982772223), (Timestamp('2018-04-18 12:29:30.908714'), 4.5616065525447045), (Timestamp('2018-04-18 12:59:30.634203'), 4.436873070669113), (Timestamp('2018-04-18 11:23:30.518884'), 4.687476499387155), (Timestamp('2018-04-19 03:05:08.649069'), 4.650786864968689), (Timestamp('2018-04-19 04:59:09.975020'), 4.700107552256333), (Timestamp('2018-04-19 02:36:06.950848'), 5.005093670657329), (Timestamp('2018-04-18 11:58:30.633590'), 4.516955155071388), (Timestamp('2018-04-18 12:04:30.649676'), 4.536891483820938), (Timestamp('2018-04-19 02:15:04.887946'), 5.150813563476811), (Timestamp('2018-04-19 04:39:07.759472'), 4.698744778330399), (Timestamp('2018-04-19 02:13:04.644721'), 4.610771573892409), (Timestamp('2018-04-19 05:02:07.981670'), 4.788410099058453), (Timestamp('2018-04-18 11:44:30.474084'), 4.467219931855227), (Timestamp('2018-04-18 11:25:30.508011'), 4.421065221579064), (Timestamp('2018-04-19 03:59:07.281691'), 4.7416534335856895), (Timestamp('2018-04-18 12:16:30.519059'), 4.450820333214946), (Timestamp('2018-04-19 02:53:09.873988'), 3.968167978219329), (Timestamp('2018-04-19 02:16:05.802788'), 4.859242678492049), (Timestamp('2018-04-19 02:37:07.907961'), 4.7410381787602045), (Timestamp('2018-04-19 04:32:07.721593'), 4.774348381018464), (Timestamp('2018-04-18 12:46:30.549483'), 4.321215294569709), (Timestamp('2018-04-19 02:19:04.826207'), 4.797840377168367), (Timestamp('2018-04-19 04:40:07.840988'), 4.6270470272421225), (Timestamp('2018-04-18 12:09:30.931871'), 4.5007778568612995), (Timestamp('2018-04-18 11:46:30.680061'), 4.45697877689301), (Timestamp('2018-04-19 02:11:05.294654'), 4.918873109181008), (Timestamp('2018-04-19 03:48:08.015856'), 4.752915728781261), (Timestamp('2018-04-19 04:42:07.755906'), 4.843500466501161), (Timestamp('2018-04-18 11:49:30.571003'), 4.424979285252632), (Timestamp('2018-04-18 12:40:31.872507'), 4.384769774402943), (Timestamp('2018-04-18 12:53:30.631747'), 4.355617843476749), (Timestamp('2018-04-18 11:34:30.589675'), 4.624258929118457), (Timestamp('2018-04-19 04:36:07.689025'), 4.777667985419154), (Timestamp('2018-04-19 03:41:08.118472'), 4.746466428193682), (Timestamp('2018-04-18 11:36:30.646821'), 4.465378937700627), (Timestamp('2018-04-19 02:04:04.999870'), 4.816617008706895), (Timestamp('2018-04-19 04:51:08.330192'), 4.620792143877193), (Timestamp('2018-04-19 04:09:08.276480'), 4.750311700167295), (Timestamp('2018-04-18 12:03:30.476317'), 4.479640168656953), (Timestamp('2018-04-18 12:13:30.455375'), 4.406443070900105), (Timestamp('2018-04-18 11:47:30.872743'), 4.4523684789456635), (Timestamp('2018-04-19 03:28:07.163478'), 4.801883298629723), (Timestamp('2018-04-19 04:10:07.268573'), 4.763350234072895), (Timestamp('2018-04-19 01:55:05.626460'), 4.908340323457582), (Timestamp('2018-04-19 02:48:08.437136'), 4.793475961021752), (Timestamp('2018-04-18 12:37:31.487654'), 4.482132078975561), (Timestamp('2018-04-19 04:52:07.975160'), 4.711210508152171), (Timestamp('2018-04-19 04:48:07.598530'), 4.6466074344686366), (Timestamp('2018-04-19 02:21:04.630142'), 4.878854940765438), (Timestamp('2018-04-19 02:43:06.045525'), 4.687168705675826), (Timestamp('2018-04-19 03:22:07.284048'), 4.7812777823267485), (Timestamp('2018-04-18 11:32:30.425655'), 4.520725072254866), (Timestamp('2018-04-19 04:14:07.488054'), 4.674354164254795), (Timestamp('2018-04-19 01:40:05.974598'), 4.865087451661152), (Timestamp('2018-04-19 05:04:07.628259'), 4.832051516022723), (Timestamp('2018-04-18 11:35:30.405573'), 4.56400403785629), (Timestamp('2018-04-18 11:57:30.416034'), 4.361094697595594), (Timestamp('2018-04-19 03:46:07.243548'), 4.709374368330024), (Timestamp('2018-04-19 05:05:08.503051'), 4.648886521041418), (Timestamp('2018-04-18 12:58:30.682071'), 4.461795572346424), (Timestamp('2018-04-18 12:26:31.356136'), 4.400606420046354), (Timestamp('2018-04-19 03:38:07.788843'), 4.6853104584735785), (Timestamp('2018-04-19 04:31:08.655941'), 4.739437452720994), (Timestamp('2018-04-19 04:23:10.543790'), 4.731542561048213), (Timestamp('2018-04-19 03:52:07.391062'), 4.802383896719433), (Timestamp('2018-04-19 04:49:07.859982'), 4.712797162604047), (Timestamp('2018-04-19 02:31:07.593714'), 4.55480935073056), (Timestamp('2018-04-19 05:03:07.819294'), 4.64590639494643), (Timestamp('2018-04-18 12:27:31.703994'), 4.358066859638995), (Timestamp('2018-04-19 04:19:07.633544'), 4.7160290281018735), (Timestamp('2018-04-19 01:35:04.949550'), 4.900977826759402), (Timestamp('2018-04-19 05:01:07.627608'), 4.735644564663117), (Timestamp('2018-04-19 03:25:09.245903'), 4.732909358224998), (Timestamp('2018-04-18 11:59:30.672687'), 4.663627769085202), (Timestamp('2018-04-19 04:41:08.088316'), 4.680705507802768), (Timestamp('2018-04-19 02:12:05.001775'), 4.639312620683888), (Timestamp('2018-04-19 04:05:18.766707'), 4.784815146384263), (Timestamp('2018-04-19 04:43:07.689224'), 4.688544024877781), (Timestamp('2018-04-18 11:54:30.798116'), 4.354427676795497), (Timestamp('2018-04-18 12:31:30.480969'), 4.418680537632723), (Timestamp('2018-04-19 05:06:07.509980'), 4.643522458184529), (Timestamp('2018-04-19 01:48:04.862497'), 4.740639922515654), (Timestamp('2018-04-18 11:29:30.787777'), 4.610401757926145), (Timestamp('2018-04-19 02:26:05.124636'), 4.627460507516731), (Timestamp('2018-04-19 04:57:07.869860'), 4.6287808031994135), (Timestamp('2018-04-18 12:50:30.516833'), 4.279528618415131), (Timestamp('2018-04-19 03:40:07.231072'), 4.745553608430402), (Timestamp('2018-04-19 01:32:07.086694'), 3.768839610980375), (Timestamp('2018-04-19 01:46:04.910136'), 4.83613552050249), (Timestamp('2018-04-18 11:50:30.527954'), 4.686695959572727), (Timestamp('2018-04-19 02:44:05.303248'), 4.893876870699199), (Timestamp('2018-04-18 12:05:30.694333'), 4.396727588934349), (Timestamp('2018-04-18 11:51:30.614182'), 4.476899431929726), (Timestamp('2018-04-18 12:55:30.475755'), 4.326094787453178), (Timestamp('2018-04-19 04:02:07.220835'), 4.788879073460447), (Timestamp('2018-04-19 03:09:07.147123'), 4.610783161733961), (Timestamp('2018-04-19 02:49:07.672686'), 4.878826988185303), (Timestamp('2018-04-19 04:16:07.301340'), 4.764173098466929), (Timestamp('2018-04-19 02:38:07.341063'), 4.71117930206638), (Timestamp('2018-04-19 03:45:07.575325'), 4.707548364838048), (Timestamp('2018-04-18 12:22:31.012354'), 4.4205813259810185), (Timestamp('2018-04-19 03:17:07.267969'), 4.743181050702402), (Timestamp('2018-04-19 01:38:05.002438'), 4.655968492662127), (Timestamp('2018-04-18 11:56:30.568675'), 4.369053518812446), (Timestamp('2018-04-18 11:21:30.557818'), 4.488482255300747), (Timestamp('2018-04-19 02:42:05.454576'), 3.8382808281120413), (Timestamp('2018-04-18 11:45:31.222744'), 4.329313601320588), (Timestamp('2018-04-18 12:08:30.497873'), 4.332104337077058), (Timestamp('2018-04-19 02:58:08.422042'), 4.586523742099345), (Timestamp('2018-04-19 01:49:04.619205'), 4.769339033870473), (Timestamp('2018-04-19 03:57:07.222491'), 4.7422767508667185), (Timestamp('2018-04-19 04:29:07.951056'), 4.702364972212927), (Timestamp('2018-04-19 04:27:07.392219'), 4.648137418604718), (Timestamp('2018-04-19 02:20:04.780033'), 4.937132786154464), (Timestamp('2018-04-18 12:41:30.668153'), 4.54115258806749), (Timestamp('2018-04-19 02:14:05.091567'), 4.681799278658807), (Timestamp('2018-04-18 11:33:30.688185'), 4.414019789743311), (Timestamp('2018-04-19 05:13:07.554326'), 4.72682682336259), (Timestamp('2018-04-18 11:53:30.629474'), 4.363890504990408), (Timestamp('2018-04-19 03:23:08.931236'), 4.7204099560875346), (Timestamp('2018-04-18 11:38:30.352019'), 4.448383103047564), (Timestamp('2018-04-19 01:43:05.305159'), 4.898563574013167), (Timestamp('2018-04-18 12:47:30.739698'), 4.336252993945942), (Timestamp('2018-04-18 12:19:30.814182'), 4.369432000326476), (Timestamp('2018-04-19 01:58:05.742995'), 4.71218319257162), (Timestamp('2018-04-18 12:23:30.734720'), 4.253013016932383), (Timestamp('2018-04-19 03:37:07.600729'), 4.694464264597461), (Timestamp('2018-04-18 12:15:30.979473'), 4.541918057963361), (Timestamp('2018-04-18 12:17:30.498588'), 4.40150171902817), (Timestamp('2018-04-18 12:18:31.538743'), 4.456083048937212), (Timestamp('2018-04-18 12:51:30.705844'), 4.502483019699393), (Timestamp('2018-04-19 02:01:05.311450'), 4.9466639242007755), (Timestamp('2018-04-19 02:41:07.876715'), 4.592598710636145), (Timestamp('2018-04-19 02:27:04.777023'), 4.626805629756275), (Timestamp('2018-04-19 04:45:07.517665'), 4.61521708942339), (Timestamp('2018-04-18 12:52:30.479546'), 4.533766371037216), (Timestamp('2018-04-19 02:55:07.756245'), 4.817978266100042), (Timestamp('2018-04-19 05:08:07.574342'), 4.640815902675537), (Timestamp('2018-04-19 03:29:07.838790'), 4.763057501871601), (Timestamp('2018-04-18 11:42:30.593685'), 4.425334880038545), (Timestamp('2018-04-19 02:02:06.094354'), 4.6559144327819535), (Timestamp('2018-04-18 11:55:30.372571'), 4.414643826787841), (Timestamp('2018-04-19 03:31:07.391958'), 4.7624050238295315), (Timestamp('2018-04-19 03:12:07.278837'), 4.7981213755440955), (Timestamp('2018-04-19 01:54:06.950822'), 4.915800608894196), (Timestamp('2018-04-19 03:07:09.183825'), 4.570535155240164), (Timestamp('2018-04-19 03:42:07.200681'), 4.7391592958211834), (Timestamp('2018-04-18 12:57:31.288942'), 4.346607003997397), (Timestamp('2018-04-19 03:36:07.103943'), 4.804104386582676), (Timestamp('2018-04-19 03:49:07.307994'), 4.756111172783144), (Timestamp('2018-04-18 12:00:30.908551'), 4.432575251182584), (Timestamp('2018-04-19 04:55:07.448956'), 4.7331381993608215), (Timestamp('2018-04-19 03:03:07.560772'), 4.715476374442231), (Timestamp('2018-04-18 12:36:30.579141'), 4.467236011155776), (Timestamp('2018-04-19 02:08:04.916723'), 4.827346003653761), (Timestamp('2018-04-19 02:47:07.521007'), 4.758043212746024), (Timestamp('2018-04-19 03:00:08.112084'), 4.514880386647765), (Timestamp('2018-04-18 11:30:30.661314'), 4.5429084972882094), (Timestamp('2018-04-19 05:00:07.656891'), 4.698183247211242), (Timestamp('2018-04-19 03:11:07.255345'), 4.644506443984071), (Timestamp('2018-04-19 01:56:05.473527'), 4.6785918514603235), (Timestamp('2018-04-19 02:35:06.212724'), 4.841670092314067), (Timestamp('2018-04-19 04:11:07.629287'), 4.936986000530079), (Timestamp('2018-04-18 12:35:30.810640'), 4.430699652450904), (Timestamp('2018-04-18 12:01:30.490037'), 4.38055539601681), (Timestamp('2018-04-19 01:36:04.565389'), 4.696738395311353), (Timestamp('2018-04-18 12:06:30.652321'), 4.319691314525096), (Timestamp('2018-04-19 03:47:07.211075'), 4.7859235549266534), (Timestamp('2018-04-19 02:10:05.321568'), 4.720471191492483), (Timestamp('2018-04-18 12:38:30.818006'), 4.601354800659197), (Timestamp('2018-04-19 03:19:07.354734'), 4.698235969001505), (Timestamp('2018-04-18 12:07:30.711686'), 4.4456014478341555), (Timestamp('2018-04-19 03:55:07.910805'), 4.353197683406278), (Timestamp('2018-04-19 03:32:07.336886'), 4.654272001127435), (Timestamp('2018-04-18 11:22:31.211920'), 4.61634070520078), (Timestamp('2018-04-19 01:52:05.673186'), 4.7224979062362795), (Timestamp('2018-04-19 01:59:05.289661'), 5.004478336368991), (Timestamp('2018-04-19 02:56:07.959237'), 4.617710694511661), (Timestamp('2018-04-19 04:24:07.520254'), 4.738798813489022), (Timestamp('2018-04-18 11:27:30.445525'), 4.51777495215868), (Timestamp('2018-04-18 12:39:30.523790'), 4.32118938426468), (Timestamp('2018-04-19 01:53:04.702569'), 4.8450447127322995), (Timestamp('2018-04-19 03:04:08.444203'), 4.598952381642223), (Timestamp('2018-04-19 03:51:07.212616'), 4.592237452141163), (Timestamp('2018-04-19 03:21:07.258253'), 4.895109947207758), (Timestamp('2018-04-19 01:44:04.922816'), 4.847557159114791), (Timestamp('2018-04-19 04:03:07.326311'), 4.625202535622544), (Timestamp('2018-04-19 04:28:07.768573'), 4.72039103255556), (Timestamp('2018-04-19 03:18:07.332206'), 4.678324641000601), (Timestamp('2018-04-19 04:04:07.499586'), 4.802796590346794), (Timestamp('2018-04-19 03:44:07.246683'), 4.7833412989967385), (Timestamp('2018-04-19 02:40:13.223562'), 4.721874337121487), (Timestamp('2018-04-19 04:01:07.707952'), 4.807463898774039), (Timestamp('2018-04-18 11:37:30.555011'), 4.640433970714188), (Timestamp('2018-04-18 12:30:32.318810'), 4.526942931338195), (Timestamp('2018-04-18 12:10:30.589894'), 4.458746479077927), (Timestamp('2018-04-19 04:54:07.869035'), 4.629926413874565), (Timestamp('2018-04-19 02:07:05.670918'), 4.801050607513965), (Timestamp('2018-04-18 12:25:30.682680'), 4.425443946894406), (Timestamp('2018-04-19 04:53:07.608898'), 4.695328674516428), (Timestamp('2018-04-19 04:58:07.636021'), 4.701657180222769), (Timestamp('2018-04-19 04:26:07.583316'), 4.718752906853033), (Timestamp('2018-04-19 03:30:07.128289'), 4.806922048708827), (Timestamp('2018-04-18 12:28:30.842157'), 4.413393767405322), (Timestamp('2018-04-18 12:24:30.575716'), 4.478535083206168), (Timestamp('2018-04-19 01:45:07.839775'), 4.49799234575212), (Timestamp('2018-04-19 03:26:07.531814'), 4.8553757699695215), (Timestamp('2018-04-19 05:11:07.321916'), 4.851239977817178), (Timestamp('2018-04-18 12:14:30.652537'), 4.4852612819189055), (Timestamp('2018-04-19 03:02:07.333559'), 4.791744682085855), (Timestamp('2018-04-19 02:24:05.322718'), 5.028075996431493), (Timestamp('2018-04-19 02:18:05.632908'), 4.579984694779116), (Timestamp('2018-04-19 02:22:05.027720'), 4.801517040964788), (Timestamp('2018-04-19 05:12:07.683294'), 4.655294648839859), (Timestamp('2018-04-19 04:15:07.269936'), 4.750603201150475), (Timestamp('2018-04-18 12:32:30.462913'), 4.384652821522423), (Timestamp('2018-04-19 03:58:07.386972'), 4.620666469307697), (Timestamp('2018-04-19 02:03:06.244939'), 4.987482665380561), (Timestamp('2018-04-19 02:45:06.018773'), 4.743432589934781), (Timestamp('2018-04-18 11:24:31.246275'), 4.446099125187183), (Timestamp('2018-04-18 12:44:30.664472'), 4.416037402325606), (Timestamp('2018-04-19 03:35:07.155204'), 4.669668485224585), (Timestamp('2018-04-19 01:39:04.721845'), 4.92302276209809), (Timestamp('2018-04-19 01:50:05.875464'), 4.603611199959174), (Timestamp('2018-04-19 04:06:09.284585'), 4.730998400209922), (Timestamp('2018-04-18 12:43:31.108817'), 4.511928990828664), (Timestamp('2018-04-18 12:48:30.966850'), 4.53283927488386), (Timestamp('2018-04-19 03:56:07.968252'), 4.6289013916958535), (Timestamp('2018-04-19 02:54:07.149911'), 4.417213843939276), (Timestamp('2018-04-19 02:57:07.155598'), 4.392161876301822), (Timestamp('2018-04-19 01:37:04.864574'), 4.610344235995893), (Timestamp('2018-04-19 03:14:07.646178'), 4.690373908509499), (Timestamp('2018-04-19 01:41:04.579161'), 4.675403858911123), (Timestamp('2018-04-18 12:56:30.551912'), 4.477649926908607), (Timestamp('2018-04-18 12:45:30.844057'), 4.536422110587834), (Timestamp('2018-04-19 03:16:07.814198'), 4.5583620148299495), (Timestamp('2018-04-19 02:28:04.746333'), 4.869157240595231), (Timestamp('2018-04-19 02:33:07.055693'), 4.7941045386017525), (Timestamp('2018-04-18 12:02:30.426851'), 4.504743945849373), (Timestamp('2018-04-19 02:50:05.180313'), 4.729807404503059), (Timestamp('2018-04-18 11:48:30.683717'), 4.647976473347516), (Timestamp('2018-04-19 04:50:07.518108'), 4.710171419062006), (Timestamp('2018-04-18 12:21:30.613058'), 4.48897112166736), (Timestamp('2018-04-19 04:00:07.593096'), 4.559668275013656), (Timestamp('2018-04-19 03:33:07.336903'), 4.8166653019448304), (Timestamp('2018-04-19 02:25:06.345096'), 4.8506795326789796), (Timestamp('2018-04-19 04:56:08.026888'), 4.787221854981777), (Timestamp('2018-04-19 04:47:07.554723'), 4.687221774957478), (Timestamp('2018-04-19 04:46:08.031190'), 4.7923170894440545), (Timestamp('2018-04-18 12:11:31.749911'), 4.398298319635849), (Timestamp('2018-04-19 01:47:04.744031'), 4.7297606147819735), (Timestamp('2018-04-19 03:34:07.193774'), 4.744651620696978), (Timestamp('2018-04-18 11:39:31.282629'), 4.628215604603334), (Timestamp('2018-04-19 04:35:07.408570'), 4.657105267888797), (Timestamp('2018-04-18 11:26:30.460244'), 4.370145812583828), (Timestamp('2018-04-19 02:46:06.781752'), 4.9701315664592425), (Timestamp('2018-04-18 11:41:31.389126'), 4.495910772251435), (Timestamp('2018-04-18 12:12:30.770047'), 4.388332822547206), (Timestamp('2018-04-19 04:33:07.857935'), 4.722601850308753), (Timestamp('2018-04-19 04:18:08.261560'), 4.712693413298181), (Timestamp('2018-04-19 02:34:05.902956'), 4.809059683880285), (Timestamp('2018-04-18 12:54:30.837672'), 4.3849504845245715), (Timestamp('2018-04-19 04:38:08.381912'), 4.734045748042842), (Timestamp('2018-04-18 12:49:30.463490'), 4.554879065439661), (Timestamp('2018-04-19 03:08:07.287444'), 4.646870619194993), (Timestamp('2018-04-18 11:52:30.591304'), 4.468370456321661), (Timestamp('2018-04-19 02:23:05.061099'), 4.980562563369955), (Timestamp('2018-04-19 02:32:06.147551'), 4.4745146248912775), (Timestamp('2018-04-19 03:10:09.552766'), 4.454725352321103), (Timestamp('2018-04-18 11:28:30.923146'), 4.530601493071297), (Timestamp('2018-04-19 03:54:07.265730'), 4.740850756972146), (Timestamp('2018-04-19 03:43:08.919254'), 4.714950230621826)]
(Pdb) p metric.archive_policy
(Pdb) p metric.archive_policy.__dict__
{'back_window': 0, 'definition': [{'points': 300, 'granularity': 300.0, 'timespan': 90000.0}, {'points': 100, 'granularity': 900.0, 'timespan': 90000.0}, {'points': 100, 'granularity': 7200.0, 'timespan': 720000.0}, {'points': 200, 'granularity': 86400.0, 'timespan': 17280000.0}], '_sa_instance_state':
(Pdb) p metric.archive_policy.aggregation_methods
set([u'count', u'max', u'sum', u'mean', u'min'])
(Pdb) p metric.archive_policy.max_block_size
86400.0
(Pdb) p metric.archive_policy.back_window
0
(Pdb) p metric.archive_policy.definition
[{'points': 300, 'granularity': 300.0, 'timespan': 90000.0}, {'points': 100, 'granularity': 900.0, 'timespan': 90000.0}, {'points': 100, 'granularity': 7200.0, 'timespan': 720000.0}, {'points': 200, 'granularity': 86400.0, 'timespan': 17280000.0}]
3.1)分析聚合处理监控数据的整体流程
_compute_and_store_timeseries(self, metric, measures):
处理逻辑:
步骤1. 对待处理监控数据按照时间从旧到新排序,获取监控项中聚合方法,采样间隔等信息
步骤2. 调用_get_unaggregated_timeserie_and_unserialize方法获取未聚合的时间序列数据进行反序列化,来重新构建为新的时间序列,具体步骤如下
2.0. 先根据监控项id构建需要获取的对象名称,形如:gnocchi_01f0658b-f147-482b-bca9-f474a79320dc_none_v3
从ceph中读取该对象存储的值(是一个字符串)
2.1. 先解压从步骤0中读取的数据(实际是一个字符串),前面一半为时间,后面一半为时间对应的值
2.2. 解压的时间由于采用差值,所以累加计算每个时间;
2.3. 将时间列表,值列表来构建时间序列,然后根据block_size(实际是最大采样间隔)对序列计算出这个时间序列中最后一个数据,
在一天之前的起始时间,以该时间为基础,对此时间序列进行切片,得到最终需要处理的时间序列
2.4. 用步骤3的时间序列,block_size等实例化并返回最终需要处理的BoundTimeSerie
步骤3 计算聚合后的时间序列,具体调用ts.set_values方法处理过程如下
3.1. 对给定的已经合并了待处理数据生成的时间序列和未聚合的时间序列的合并时间序列boundTimeSerie进行如下操作
3.2. 遍历归档策略,根据采样间隔,聚合方法:
计算每个boundTimeSerie聚合后的时间序列;
并对该聚合的时间序列分割,计算分割序列的偏移量和对应序列化的值;
根据偏移量,将序列化的值写入到对应的ceph对象
总结:步骤3实现了: 计算聚合后的时间序列,将聚合后的时间序列写入到ceph对象中
步骤4. 更新未聚合的时间序列,具体调用_store_unaggregated_timeserie方法处理过程如下
4.1. 对时间序列的索引进行numpy.diff的求差值操作,并
在所求的索引差值列表的最前面加上该时间序列的第一个值,
得到差值索引列表
4.2. 对差值索引列表的类型转换为uint64类型
4.3. 对时间序列的值列表类型转换为浮点型
4.4 对差值索引列表转换为字节 + 对时间序列的值列表转换为字节,
得到字符串
4.5. 对该字符串调用lz4.dumps进行压缩,返回该压缩后的字符串
4.6 构建类似gnocchi_01f0658b-f147-482b-bca9-f474a79320dc_none_v3的对象名称,
向该对象中写入未聚合的时间序列的压缩后的字符串
该字符串序列化前的前半部分为:时间序列索引,后半部分为时间序列值
3.2)接下来分析的重要方法有
在4的中分析 _get_unaggregated_timeserie_and_unserialize: 获取未聚合的时间序列数据进行反序列化,来重新构建为新的时间序列。
在5的中分析 ts.set_values: 计算聚合后的时间序列
在6中分析_store_unaggregated_timeserie: 更新未聚合的时间序列
4 分析 _get_unaggregated_timeserie_and_unserialize: 获取未聚合的时间序列数据进行反序列化,来重新构建为新的时间序列
ts = self._get_unaggregated_timeserie_and_unserialize(
metric, block_size=block_size, back_window=back_window)
进入代码
class CarbonaraBasedStorage(storage.StorageDriver):
def _get_unaggregated_timeserie_and_unserialize(
self, metric, block_size, back_window):
"""Retrieve unaggregated timeserie for a metric and unserialize it.
Returns a gnocchi.carbonara.BoundTimeSerie object. If the data cannot
be retrieved, returns None.
"""
with timeutils.StopWatch() as sw:
raw_measures = (
self._get_unaggregated_timeserie(
metric)
)
LOG.debug(
"Retrieve unaggregated measures "
"for %s in %.2fs",
metric.id, sw.elapsed())
try:
return carbonara.BoundTimeSerie.unserialize(
raw_measures, block_size, back_window)
except ValueError:
raise CorruptionError(
"Data corruption detected for %s "
"unaggregated timeserie" % metric.id)
分析:
4.1)变量分析
(Pdb) p metric
(Pdb) p metric.__dict__
{'status': u'active', '_sa_instance_state':
(Pdb) p block_size
86400.0
(Pdb) p back_window
0
(Pdb) p raw_measures
'\xc0\x12\x00\x00\xf1\x1d\xc0\x96\'g\xa8^&\x15\x90\xa9\x8f2\x0e\x00\x00\x00@\xb0+\xc7\r\x00\x00\x00\x88I\x05\xfd\r\x00\x00\x000\xab\x94\xfa\r\x00\x00\x00\xe0\xd1\x08\xf6\x10\x00\xf1$D\x82-\x0e\x00\x00\x00X\xce\x84\xd3\r\x00\x00\x00\xd8\x8c\x04\xde\r\x00\x00\x00\xf8\xd3x\xf8\r\x00\x00\x00 \xcf\xa8\xff\r\x00\x00\x00p\x05\xc6G\x0e\x00\x00\x00(\xc3\x89\xeb \x00\xb1\xd7\xc2\xb4\r\x00\x00\x00x\xf0N\xf9P\x00\xb1\xf0\xd38\x0e\x00\x00\x00H\xd5l0(\x00\xf1\x14\xa4X\xb9\r\x00\x00\x00\x805i\xba\r\x00\x00\x00h\xc7\xef\xfa\r\x00\x00\x00\xa0\x8b\xed\x05\x0e\x00\x00\x00x#t\xe78\x00\xb1\x12G\x17\x0e\x00\x00\x00\xc8\xd7b\xe0\x90\x00!\'\x1b\xa8\x00\xc1H[\xbf\xee\r\x00\x00\x00`Y|\x07X\x00\xf1\x04\xc9\x12\xec\r\x00\x00\x00\x18-\xa4\xf4\r\x00\x00\x00\x90\r\x17\xf7\xd8\x00\xf1+\xec^\xfb\r\x00\x00\x00\xd0\xb9\xbf \x0e\x00\x00\x00\x88\xb1\xde\xcf\r\x00\x00\x00\xa8\x87~\x0c\x0e\x00\x00\x00\x18\xaea\x06\x0e\x00\x00\x00\x98@\x9d\xe5\r\x00\x00\x00@\xf1]\xea\r\x00\x00\x00\x08\x97\xbeh\x001\xd8\xae8\x90\x00A\xb0\xb0$\xef\xa8\x00\xf1\x033\xa8\x03\x0e\x00\x00\x00\xe0\xf0\xf3\t\x0e\x00\x00\x00\xe8D2P\x00\xf1\x04xSv\x0f\x0e\x00\x00\x00h\xda:)\x0e\x00\x00\x00\xa0\xeb\xfc\x08\x01AX\t\x1f\xd1\xd8\x00\xb1\xbc\xfe\'\x0e\x00\x00\x00\x08\xa2\x15\xc9h\x00!,c \x00\xc1\xb8`\x98\xf5\r\x00\x00\x00\x98:V\xf1\xa8\x001Q~\x0b\x00\x01\xf1\x04\xdch\'(\x02\x00\x00\xb8\x03\xf2\x11\t\x00\x00\x00xJ\xba\xbb8\x00\xb1f\xf7+\x0e\x00\x00\x00\xa0\xb5&\xa8 \x01!\xd1\x98\x90\x01A\xd0\x14_?\xd0\x00!\x18H(\x001\xe0v\x86@\x01\xf1\x05\x10\xe8f$\x0e\x00\x00\x00\xd8\x05w\xd9\r\x00\x00\x00(\xd5\xe3\x1a\x08\x011\xe2JK\xb0\x00"\t\xd5\xd8\x01!\xe2\x93P\x00APE\x9b\xe9\xb8\x01!\xff\xcc`\x011\xb8\xfe\xc1(\x00A\xe0:\xf1\xc2@\x00!\xc1\xa2H\x00\xc1\x80\x15\xf7<\x0e\x00\x00\x00P\xaf\x91\xc5\x88\x0113\xdb\x14\x80\x00!`\x99@\x011\x88\xcc\xda(\x01\xc1\xc0\xecZ\xdb\r\x00\x00\x00\xc017(\xc8\x01\xf1\x03\xc7N\xc8\r\x00\x00\x00H%\xc1\x04\x0e\x00\x00\x000\xdfPh\x02\xb1p\x9d\xc2\xfe\r\x00\x00\x008h>X\x01A\xd8\xf1a\xe4\xe0\x001]\x1a\x12\x10\x01\xf1\x03A\xcf\xd7\r\x00\x00\x00P\xa0_\xed\r\x00\x00\x00\x00\xf9L(\x01\xb1\x80\x16r%\x0e\x00\x00\x00\x90u\x07h\x001\xc8<\xe4(\x0218D\'x\x021\xa8\nZ@\x00A\x00\xfbB\xdc\xb0\x02"\xda\xfc`\x00!\xb9Fp\x01\xb1(\xea\x06\x1f\x0e\x00\x00\x00p\xe0\xe6\x98\x011\xc8Oe\x10\x021x\xb0/@\x001\xe8\x84\xae\x98\x00\xb1h\xcdz7\x0e\x00\x00\x00\xb0|\xda`\x00A\xf8\x88H\xce\x10\x011\xae\x9b\xf3\xb8\x01!\xc4\xfe \x02\xf1\x04P_0\x08\x0e\x00\x00\x00\xf0Tf\xdd\r\x00\x00\x00\xa0{\xeb\x10\x011\xb0a\nP\x001h\xb44x\x031\x90\xb3\xacx\x00A\x18V\xf1\xab@\x00!Y\xd0\xd0\x0018\x9d\xc8\xc0\x02A\xb8\xe5\xf1\xdfX\x011 \x159P\x001\x80\xe3\xc0p\x00\xa1f\x19\xe1\r\x00\x00\x00\x10%J0\x031\xd8H\xbeP\x03A\xd0-\x8d\xcb\x18\x012$\xd8\x04\x98\x01\x11\xf4\x98\x001pW@\xd8\x02\xb18\x1b\xb0H\x0e\x00\x00\x00 \xa5\x8b\xd0\x02A\xf8\xde\x07\x91H\x001\x9f\xf5\xe8\xa0\x01!\xd2\x80\xf8\x00A\x98\xb6\xeb/0\x021l8\xf2\x90\x011m\xb1\x0e0\x021\xa5\xee\xa3\x80\x011\xa4{\x81 \x001\xc6C\xc4\x10\x04!e\xa9\x08\x011\xa0jQ\xa0\x01A\xb8\xa8cdX\x021q\xb4\xa5\x88\x031\\}\n\xa0\x011\xf2\xbf\xe6\x90\x03!\xbbLX\x021@"p\xa0\x03\xc1\xa8\xf7\x11"\x0e\x00\x00\x00\xf8Em\xe20\x001\xb0M\xe6h\x03!{\xf2\xb0\x00A\x009\x9a\xb0\xf8\x00!%\xbaP\x021@$\x88\xe8\x03\xb10\xbb\x97\x00\x0e\x00\x00\x00\xd0\x1d#H\x031\x88\xfbB\x98\x01A\xa0\xe0\xa3J0\x01!f\xe5\xe0\x011\x98\xea\x05\xd8\x011\xb0\x18U\xd0\x001\x88}\xe5\x08\x001\xc8!UP\x001hY\rH\x001\x98[\x1e\xc0\x011\xb0\xd1\x10\xc0\x00A\xe0\xae\x8c\x1c\xf0\x011\xa1\x11\x80\x10\x04!\xed\xa0\xe8\x03\xc1\xb8\x9d?R\x0e\x00\x00\x00\xb85\xe6\xc3\xe0\x011\x98\x06\xf8@\x021\x1dS!\xc8\x031\xfeQ\xa0\xb8\x02!\xb7Yh\x011\xc0Oj\xe0\x031\xe8E]\xf8\x001\x90\xb8x\xc0\x03A`;\xc0\xbe@\x01!\x14\x9a\x90\x001\xb0\xc2=@\x031\xa0\x1ff\xc8\x00\xc1\xd8\xaa6=\x0e\x00\x00\x00\x10\x14\x94\xc1x\x01!\xf9L\xa0\x01\xc1\xf8`\xa1\xe3\r\x00\x00\x00\xb0[X\x01p\x03!4A\x10\x01A\xa8\xb3\xa0\x13\xa8\x05!B\xcf\xf0\x041\xf0\x17Wp\x05AX\xe2\x18\x9f@\x001\x9b\xfb#p\x031 \x1e\x15\x88\x031\xab\xbf\xaf\x88\x03!\x8aZH\x001\xd8\xfeU\x90\x011 \xf3T\x18\x051\xe0q\xad\x98\x001\x98T\xc8 \x01A\x90\xbb7\xd8\xb0\x00!\xcfM\xa8\x02A@\xf8\x1b\x1bP\x00!\x05)x\x021x\xdc\xbcP\x011\x80\xe7\x02\xc8\x01\xf1\x1ch|\x95\xef,\x0f\x00\x00\xc8!\x81T"\x00\x00\x00\x18\xbb,(\x1e\x00\x00\x00\xf8Qh\x1b\x0f\x00\x00\x00\x18\xd0\xb8\xc5\x0c\x00\x00\x00\x80\xa6\x17\x10\x0420r)@\x00\xf1\x0b\x03s[\x17\x00\x00\x00\xf8\xd4\x0b\xd7\x0e\x00\x00\x00\xf8\xb4\x00\xc3\x0c\x00\x00\x00\xf8\x86. \x00A(=\x8a4x\x001\x8c\xff\xae0\x02!\x00\xb6`\x021\xf0\x19T\xf0\x02A\xa8X-A\xd0\x051\xdeK\x11\x18\x061\x08\xb2\xef(\x001\xb5\x83\xfex\x00\xa1\xd6\x12\xa8\x0b\x00\x00\x00\x88\xa6\x8dP\x001\xc8\xadoh\x031\xf0\x93\'\xb0\x0110\xc5U\x10\x03A\xe8KZ\x18@\x00!\xca\xf2\xf8\x00A\x18uh\xfc\x90\x03\xa1\xb6\x98\x1f\x0e\x00\x00\x00\x00\x03F\x18\x04A\xb0pw\xdc(\x03!\x0b\xbf\x80\x051\xe0=\x02`\x04A\x98>H\x92\xd8\x03!u\xdc\x80\x051\x00J\x8ch\x001H\xed\x96@\x02A\x18\xcdA\x8a\x00\x07\xf1\x0bS\xc4\xd3\x1b\x00\x00\x00\x88,\x9fAb\x03\x00\x00\xc0\xa4\x95\x11\x1c\x00\x00\x000\x8b\xbf8\x06"(u\xd8\x01A\x98v\xb8\\h\x02\xa1\x8e-{\r\x00\x00\x00(\x0b\x83x\x071\x08\xb1\x97\xe8\x051\xb0\x82I\x90\x07A\xf8\x0f\x08\x1ep\x03!H\x95\xb0\x021p\x991@\x041\xa8\xa9\xad\xb8\x001\xe8{[\xd0\x00A@\xa1\x95\xd5\xd8\x021=7\x93\xd0\x001K\x01L\x18\x07!\xfa\xe4@\x0018Nw\x00\x03AH\xd3\xb5\x99X\x07!\x0f\xa2h\x0118b|\xd0\x04\xb1\xd8\xa8:\xf0\r\x00\x00\x00\xf0\xe4\x9a\x88\x041\xd0\xfc) \x001\x88\x1e3\x10\x001PN\x7f\xa8\x021\x88\x9f8@\x021\x80\x85q\x00\x031\xb8H=8\x001\xe0W\xaf\x90\x021\x10\xb5\xf8P\x061\xd0\x1fLp\x021\xc0\xc9\x91(\x051\xb8\xb6H\x08\x001\xa0\xf3u@\x011\xc80>\x80\x011\x18\x06Vp\x041\x00\xd7\x05\x10\x001\x98\xe9?P\x0318\x88\xd7P\x031\x18\xac\xb6\xa0\x001@v\xc1 \x001\xc8\x8a\xb8\x90\x001p)\xd6x\x001\x983\xd0\xa8\x001P\x1d\x9b0\x011\x80~\xbd \x051`\xa7c\xb8\x011XsG\x18\x001\x18kX\x08\x00\xb1\x88\xedV\xe4\r\x00\x00\x00\xa0\x14\x93p\x011\xb8\xf0VX\x00\xb1\xd0\x1d\xeb\x1d\x0e\x00\x00\x00\xa0\xcb\\h\x011(\x8a\xb9h\x02\xf0\xff\xff\xff\xff\xff\xff\xff\xff\xffZ\xb8\xe6\x01\xc4\xdd\x11\x13@\x9dAD\xb2\x96\xd3\x12@\xf7D\r\xa2\x1c!\x13@\x8b0\xa6R\x1eO\x12@$\xac\xeb8\xb4\xc9\x12@\x15#>\x06\x97\x9c\x12@L\xc6\xaa;7\x86\x12@ n\x0e\x9e\xc8\xfe\x12@\xdc\xa3u\xa6>\x89\x12@b\x16\xa4\x0e6w\x12@2\xe6^X\xeb\xd3\x12@\x94\x8c57sS\x12@\x00\xf0\xe7\x98\xe6U\x13@\xe3\x9be\x03@\x9e\x12@\xe0}\xe2O\x0be\x12@l\xe1o\xfbxw\x12@$i=\x81\xcd`\x12@\xbe\x0b\x19\x9b%\xcc\x12@^\xa2\xfa\x87\x1eQ\x12@[\xe6\xd1\x06\xd9Q\x12@\xf3o\x18&}C\x12@Vi@v\x138\x12@\x03\xea\xab\x0eH\xc5\x12@b\xce\xedi\x89R\x12@F\xfc\x87i.\x93\x12@3\x0e\x11v\x8c\xc8\x12@\xd2\xfa\xcf\xcfn\x96\x12@\xf3*%\t\x08\xbb\x12@\xa9\x9e\xa9\x98\x1cZ\x12@]\xec|H\xd2E\x12@\xa8\x105r\xa4\xc8\x12@\x02a\x8f\xf9r\xda\x12@\xacI\x0eJ~\xad\x12@o\x8aw_\xddm\x12@Y\xb0\xa0\xae\xe4\x1f\x13@\xech\xa9\xc6\xcc\\\x12@\x08+\x0cD\x87V\x12@c\xa0C\x07\x7f\xd6\x12@M\x8c\xcbNo\x99\x12@o/\x8b\x8f\x05.\x12@zd}<\x89\xbd\x12@.\x0b\xdf\xd57`\x12@\x11\xd1^\xb2\xba\x04\x13@\x0c\x18\x84l\xeez\x12@\x87\xc2\xfe:\xa6\x9c\x12@\xa3>Lt%\xbb\x12@\xa6w3\xf2\x08x\x12@\x88\xb4\xc7\x15S\x03\x13@\xe0I\x98\xd6\xeaN\x12@7{;=\x0eD\x12@f`\xa8\xfbi\xd0\x12@\xb6\x11|s\x0f\xc5\x12@\xb7\xabi\xff \x91\x12@\x8c\x9b\xe5\xbc5\xc1\xc3? \xaev\xca\xaa\x9c\x13@\xac\xf9\x83K~v\x13@(+m\xe9\xe0\xe5\x14@\xde\x19\xb8\x16\xa2\xcc\x14@\x97\x9e\x9b\x8a\x9aX\x14@\xe6\x8e?-\x8bC\x14@\xf3|\x1d/\x07\x02\x14@a^p\xf2\\\xc2\x13@X\xe4i\xa72\xe0\x14@\xe0\xf4KG\xcc\x84\x15@B\xd3x\x99`\xd1\x12@n\x9b\x05R\xd9\x8b\x13@Z9\xdffZ\xfe\x12@\nE,\n\xc8\x91\x13@\x86S\xf3l\xd1\xf2\x13@dT\xf2d]\xb7\x12@l\xb1\xa8\xf9\xc2\xd3\x12@\x96\x18\x0f\x06\x97\xb1\x13@\xa7\xa8Q\x8d\x1b\x80\x13@K\'\x97\xb0\xe8\x0f\x15@S\xef\'\xdc\xb4\x15\x14@\xbdV\xec\x8c\xb9\x80\x14@\xc1V\x0c\xe1+Y\x15@H!\xe6\xfe\xe2B\x16@\x1c\xbc\xbe\x05\xb7\x1c\x16@*\x94\x97\x89G\xa1\x16@\x84\xb4TL\x85\xcc\x13@\x00\xc0V\xcf\x1e3\x13@\xa1\xa9>]\x95\xcf\x13@<\xc3]\xa7|\x7f\x13@\x04\xffl\x13\xf0_\x13@\x04\x9cV\xfe5\x96\x15@hC\x0b\xb1t\n\x16@??\x1e\xcb\'\x11\x16@\x8c;8\'Ae\x14@-\xef\xa3\'\xdd\x06\x14@\xa9\xab\x94\x90*J\x13@\xaf\x0f\x80H\xce\x07\x14@\x17\x06\xb8\xba\xff\xbd\x15@\xe5=\xaa{O\x98\x14@\x98\x8a\xe8\xbc\xe2\xeb\x13@e\xd9^\xf6g&\x13@\x9c\x1dp\xdd\xdb\x91\x13@\xb5zPr\x0b\n\x14@\xf9\xad\xec\x8a\xd19\x16@\x94&\x05b\xa6\xa7\x13@\xb2SD\xf4\xdf\xfd\x12@d\xd3u\x1d\xb4\xed\x12@\xb5]\xd5\xd0Q\xd4\x14@\xc7\xc4\x98\xb52\x9e\x15@5\x93n\x071\xab\x14@\x13\xcc\xd8\xa9A\x17\x13@k\x8c\xba\x93\xdf(\x14@\x83{3W\x96\x1d\x15@G\x04\x1d\x13^\x94\x13@1Xg\xe9$\x9f\x14@6\x8a\x9c\x13\xce\xdf\x13@\x11j\x01\xc9Yv\x14@tWnR\x0f\xd4\x12@\x141\xdd\x1a\xc8\x92\x14@TP\x0c\xf8\xf6\x8c\x13@K\xe7J\x1c\x8f{\x15@\x7f\x8ag\'\x82\x9e\x13@U\xfat\x83\xfex\x14@\xba\x90a\x15\xed\xe7\x13@,\xd0\x0f\xd1;\x0f\x15@\xae\xb0\xac\x9a\xc8g\x15@fpi\x83\xb8\xda\x15@\xad\x00Q\x81\xaa\xeb\x15@\xad(\x83\xbd\x9cX\x16@7\xb5\x92\x02(\xba\x14@\x98\x96\xff?\xb6\xe3\x12@\x16\x9c\x08\xeb\xdb\x08\x13@\xbb\xa4\xc3\xb1@\x04\x14@\x86u\xab\xfc\x1au\x14@\xd3\xb2g\r1\x1d\x14@\x8a\xfc\x1b\xa3\x10&\x13@C\x8d\xa4e\xbc\x86\x12@\xc9\x85-\xa0?\xcf\x14@E\x87k\x9a]\xe7\x15@]\x01\xdbc\xcd\x0f\x16@$\x9e\xb05r\x98\x13@2\x18*\xebV\xbf\x12@\xdf\xe0\t(\x81\x85\x11@4[y\x05\x82D\x11@\xa1\x0f\x00\xdff\x1e\x14@\xb2\x9e\xd9Jv\x9b\x13@\xb4x\xcc\xee0\x10\x14@|\x0ez\xdc\xe6m\x14@\x1c\xdd\xca\xbel\xa2\x14@\x10\xdb\xb8\x8eS\x0e\x14@\x90\x19vm\xa3x\x13@\x88o\x0c\x92\xa4_\x13@\x88\xe7\x8a\xc0\xc2s\x13@\x00\xfb\'\x8a+<\x14@\xe2\xb7\x07\x19P0\x15@\xb1\xd2\xed\x1f\x10R\x13@\xd3v\xa0=\x8aE\x13@\x08+\xad\x041\xdf\x15@\x02H\xed\x13\xe2\xd0\x15@\xf5\xc2\x9c\x11\xf5$\x15@*\xd3X\xe9o\xce\x14@\xfd\'.\xab\xa0\xd4\x15@\x13\xda\x11\xa5*\x1b\x16@\x0f\x07B\x1d+\x8d\x15@\\\xec\xeel\xc3\xe6\x14@\xc1\x1a$\x042\x19\x15@>e\x8bc.\xbd\x13@\xca%KQs\xf5\x12@\x82\xf6A\x1d\xb6.\x13@J?\xa5e\x8eP\x12@C\x9a\xaa\x0c\xd4\x7f\x10@\xd7\xae\xffx\xac\xef\x11@\x9c\x13@\x03\x13\xe1\x9eC\xb2\x12@\xa5\xc0\x14?\x00\x1e\x13@+\xf9\x02\x02\'\xed\x12@9\xd4\xacv\xbc\xf7\x12@\xa1\xfeK\x80\x8e\x17\x13@\xe8\x81\xbe\xe7\x00\xdc\x12@\x7f\x0e\xa4\xdaj\xc6\x12@n=\xd2;\xb3\xf3\x12@!\xc5\x923\t\xdd\x12@\r\x8bw\x00&\xca\x12@\x84\x11\xbe?\xb4P\x12@7\xe1:\x90<\xfe\x12@\xf0H\x1f\xc2\xda\x98\x12@\x83E\x89\xba\x05]\x13@\xb6X,o\xf3\xfa\x12@2\x81\xab\x18+\xfc\x12@\t\xa1\xd5C\xa4\xd1\x12@\xc4\x7f}\xe6#\xdf\x12@\xff\xf2\x1d\xac\xc3(\x13@Q$\tmq\xe5\x12@\x9e\xdd\xf4\xf2M\x8e\x12@:\xf8?W\xc7\x1a\x13@\x86\xb0\xd9\xce<\xf7\x12@`#\x92\xf6\x1az\x13@v8\x8cTK\n\x13@\x89\x12F\xf4\x92\x89\x13@\x13\xc1\xad\x14mB\x14@\xb0\x89D\x93\xca\xa01@\x86\x07\xf5\x18|\xd1\x11@m\xed\xf4>\x1fX\x12@Nn\x19\xb1\x8a\xf0\x11@\x98(\x1a\x85\x06\x80\x11@o\xcc\x93I\t\x0b\x12@\xc2\xd1\xa7\xe4\x1bX\x12@+\x83l\xca\xea\xa9\x11@\xd0\xc2\x1b\x14as\x12@\xa5\xbe\xc4{N\x89\x12@5\xa5BN\x02\x03\x12@2\xbey\xfcW\x18\x12@\xc4\xe1\xc8\xef\xd1q\x12@<(\xce8O\x1b\x12@\xbe\x92\x98\xb9\x1d\xd3\x11@\x8dj\x8f\xd8\xc0)\x12@\xf8o\xe0M\xd5\x12\x12@\xee\xc8\x8c\x06\x16\x0b\x12@\xff\xfcf\x15\x02\xb1\x12@\xb8\xc6N\xfc\xe1K\x12@\xf2,\xa8\x07t\x9c\x11@\xdf\xc4\x8e\xaf; \x12@t\xf7\x12Iu\xcd\x11@~\xc8\x06@\xc7%\x12@K\xe42O\n\xd7\x11@z\x02\x0faJ\x06\x12@4$$\xa8\xf7`\x12@`\xc0\x85X\xf0T\x12@\xfbr6j]\x1a\x12@\x88\xeb(\xb1Q\x8b\x12@\x82[\xd1\xb3\nM\x12@\xe5M\xa4\x1d~.\x12@\x01\x15\xf2\xf4\xa0\\\x11@\xb2\xd8#\x1bh\xb6\x11@9\x80\x85\xc6\xa4S\x12@\xd5\x15\xd1\xec\xda}\x11@-\x80\x10w@\xfd\r@\x8d\xce\x19y\xfbL\x12@\xcaN\xa4\xa2\x9c\xa7\x10@qV\x1f\x19\xfb\xb4\x10@\x88\x92\xb3\xb6\xa6@\x11@\xfe"\x1e\xacyW\x10@\x9f\x9b\x8d\x07\xb6\x99\x10@\x80m\x0b\x13\xec<\x12@\xa1\xact(\xdcK\x12@_\xea\x05$)\xe2\x11@\xd3d\xd6y\x1f"\x11@R\x86\x08\x124\x05\x11@p\xc5\x98s\x9eT\x11@\x10\xbe\x92\xc8\x18\xfd\x12@\xb8>\x06\xc80"\x12@O\xc7\x06p)]\x12@\x1d\xd8?N\t\x92\x11@\xe3WV\xdaq\x92\x11@\x91%\xf64@\xdc\x11@\xc4\xaf\xfd\xbb\x01\xad\x11@\xac\xd9~\xf2\x91[\x11@\xcf\xb7G\xe3S\xbc\x11@\x18\xe7\x9c\xbaNp\x12@\x82O\xc9/\x1b4\x12@~\xdd\xbd\x01\x9b,\x12@@\xe5?]\x0f\x0e\x12@\x1f\xb9\x96~\x16\xd8\x11@w\xf4p\xec\x10u\x11@\xb0(\x0exD\xd6\x11@\xa67 \x05\xa5\xa0\x11@\x9c]\x15\x19\xafr\x11@,;u\x92op\x11@\x13\xfc~\x03T\xfb\x11@\xb2S\x14\xe9\xc8:\x13@\xf75\xb5\x83\xc4\xc3\x12@\xad\x1dR\x100\xba\x10@\xa2\x14F\xf5\x84\xcb\x11@/\xb0-\xbbYp\x12@y:\xc3\x83\n.\x12@:\x12J\xe0B\x9b\x11@\xfc(`G.\xfb\x11@\x1c7\xb2Y\xb0V\x12@\x1f\xdek\x87\x1b\xaf\x11@\x95\x99\x17o&\xde\x11@\x18\xa6\xf9z1\xe9\x11@\xac\x02\xb58\\c\x11@\x81\xaf\xcd\x1a\xb6\x1a\x12@X4\x90\xeb\xeb\xe6\x12@\x86\x91?\x12b\xcc\x11@R`\x8b\xab\x08\xf7\x12@\x19|\xb1v\xf8O\x12@g\xe0r1UU\x12@\xbb\xea\xf4\x12\x95\xaa\x11@l\xcfUm\xff*\x12@\x86!E\xb6\xdf~\x12@j\xf4\xec\x1e?\xa5\x12@\x9ePAF\xe5\xe0\x11@Y\xbc\xf5\xeb\x15l\x13@\x84f\xe28\xd5\xe8\x11@'
4.2)逻辑处理分析
_get_unaggregated_timeserie_and_unserialize
s0. 先根据监控项id构建需要获取的对象名称,形如:gnocchi_01f0658b-f147-482b-bca9-f474a79320dc_none_v3
从ceph中读取该对象存储的值(是一个字符串)
s1. 先解压从步骤0中读取的数据(实际是一个字符串),前面一半为时间,后面一半为时间对应的值
s2. 解压的时间由于采用差值,所以累加计算每个时间;
s3. 将时间列表,值列表来构建时间序列,然后根据block_size对序列计算出这个时间序列中最后一个数据,
在一天之前的起始时间,以该时间为基础,对此时间序列进行切片,得到最终需要处理的时间序列
s4. 用步骤s3的时间序列,block_size等实例化并返回最终需要处理的BoundTimeSerie
4.3)关键方法分析
carbonara.BoundTimeSerie.unserialize(
raw_measures, block_size, back_window)
进入:
gnocchi/carbonara.py
代码如下:
class BoundTimeSerie(TimeSerie):
@classmethod
def unserialize(cls, data, block_size, back_window):
uncompressed = lz4.loads(data)
nb_points = (
len(uncompressed) // cls._SERIALIZATION_TIMESTAMP_VALUE_LEN
)
timestamps_raw = uncompressed[
:nb_points*cls._SERIALIZATION_TIMESTAMP_LEN]
timestamps = numpy.frombuffer(timestamps_raw, dtype=' timestamps = numpy.cumsum(timestamps)
timestamps = numpy.array(timestamps, dtype='datetime64[ns]')
values_raw = uncompressed[nb_points*cls._SERIALIZATION_TIMESTAMP_LEN:] return cls.from_data( 分析: (Pdb) p data (Pdb) block_size (Pdb) p len(uncompressed) (Pdb) p timestamps (Pdb) p type(timestamps) _SERIALIZATION_TIMESTAMP_VALUE_LEN = struct.calcsize(" 4.3.2)逻辑处理分析 参考:
values = numpy.frombuffer(values_raw, dtype='
pandas.to_datetime(timestamps),
values,
block_size=block_size,
back_window=back_window)
4.3.1)变量分析
(Pdb) p cls
'\xc0\x12\x00\x00\xf1\x1d\xc0\x96\'g\xa8^&\x15\x90\xa9\x8f2\x0e\x00\x00\x00@\xb0+\xc7\r\x00\x00\x00\x88I\x05\xfd\r\x00\x00\x000\xab\x94\xfa\r\x00\x00\x00\xe0\xd1\x08\xf6\x10\x00\xf1$D\x82-\x0e\x00\x00\x00X\xce\x84\xd3\r\x00\x00\x00\xd8\x8c\x04\xde\r\x00\x00\x00\xf8\xd3x\xf8\r\x00\x00\x00 \xcf\xa8\xff\r\x00\x00\x00p\x05\xc6G\x0e\x00\x00\x00(\xc3\x89\xeb \x00\xb1\xd7\xc2\xb4\r\x00\x00\x00x\xf0N\xf9P\x00\xb1\xf0\xd38\x0e\x00\x00\x00H\xd5l0(\x00\xf1\x14\xa4X\xb9\r\x00\x00\x00\x805i\xba\r\x00\x00\x00h\xc7\xef\xfa\r\x00\x00\x00\xa0\x8b\xed\x05\x0e\x00\x00\x00x#t\xe78\x00\xb1\x12G\x17\x0e\x00\x00\x00\xc8\xd7b\xe0\x90\x00!\'\x1b\xa8\x00\xc1H[\xbf\xee\r\x00\x00\x00`Y|\x07X\x00\xf1\x04\xc9\x12\xec\r\x00\x00\x00\x18-\xa4\xf4\r\x00\x00\x00\x90\r\x17\xf7\xd8\x00\xf1+\xec^\xfb\r\x00\x00\x00\xd0\xb9\xbf \x0e\x00\x00\x00\x88\xb1\xde\xcf\r\x00\x00\x00\xa8\x87~\x0c\x0e\x00\x00\x00\x18\xaea\x06\x0e\x00\x00\x00\x98@\x9d\xe5\r\x00\x00\x00@\xf1]\xea\r\x00\x00\x00\x08\x97\xbeh\x001\xd8\xae8\x90\x00A\xb0\xb0$\xef\xa8\x00\xf1\x033\xa8\x03\x0e\x00\x00\x00\xe0\xf0\xf3\t\x0e\x00\x00\x00\xe8D2P\x00\xf1\x04xSv\x0f\x0e\x00\x00\x00h\xda:)\x0e\x00\x00\x00\xa0\xeb\xfc\x08\x01AX\t\x1f\xd1\xd8\x00\xb1\xbc\xfe\'\x0e\x00\x00\x00\x08\xa2\x15\xc9h\x00!,c \x00\xc1\xb8`\x98\xf5\r\x00\x00\x00\x98:V\xf1\xa8\x001Q~\x0b\x00\x01\xf1\x04\xdch\'(\x02\x00\x00\xb8\x03\xf2\x11\t\x00\x00\x00xJ\xba\xbb8\x00\xb1f\xf7+\x0e\x00\x00\x00\xa0\xb5&\xa8 \x01!\xd1\x98\x90\x01A\xd0\x14_?\xd0\x00!\x18H(\x001\xe0v\x86@\x01\xf1\x05\x10\xe8f$\x0e\x00\x00\x00\xd8\x05w\xd9\r\x00\x00\x00(\xd5\xe3\x1a\x08\x011\xe2JK\xb0\x00"\t\xd5\xd8\x01!\xe2\x93P\x00APE\x9b\xe9\xb8\x01!\xff\xcc`\x011\xb8\xfe\xc1(\x00A\xe0:\xf1\xc2@\x00!\xc1\xa2H\x00\xc1\x80\x15\xf7<\x0e\x00\x00\x00P\xaf\x91\xc5\x88\x0113\xdb\x14\x80\x00!`\x99@\x011\x88\xcc\xda(\x01\xc1\xc0\xecZ\xdb\r\x00\x00\x00\xc017(\xc8\x01\xf1\x03\xc7N\xc8\r\x00\x00\x00H%\xc1\x04\x0e\x00\x00\x000\xdfPh\x02\xb1p\x9d\xc2\xfe\r\x00\x00\x008h>X\x01A\xd8\xf1a\xe4\xe0\x001]\x1a\x12\x10\x01\xf1\x03A\xcf\xd7\r\x00\x00\x00P\xa0_\xed\r\x00\x00\x00\x00\xf9L(\x01\xb1\x80\x16r%\x0e\x00\x00\x00\x90u\x07h\x001\xc8<\xe4(\x0218D\'x\x021\xa8\nZ@\x00A\x00\xfbB\xdc\xb0\x02"\xda\xfc`\x00!\xb9Fp\x01\xb1(\xea\x06\x1f\x0e\x00\x00\x00p\xe0\xe6\x98\x011\xc8Oe\x10\x021x\xb0/@\x001\xe8\x84\xae\x98\x00\xb1h\xcdz7\x0e\x00\x00\x00\xb0|\xda`\x00A\xf8\x88H\xce\x10\x011\xae\x9b\xf3\xb8\x01!\xc4\xfe \x02\xf1\x04P_0\x08\x0e\x00\x00\x00\xf0Tf\xdd\r\x00\x00\x00\xa0{\xeb\x10\x011\xb0a\nP\x001h\xb44x\x031\x90\xb3\xacx\x00A\x18V\xf1\xab@\x00!Y\xd0\xd0\x0018\x9d\xc8\xc0\x02A\xb8\xe5\xf1\xdfX\x011 \x159P\x001\x80\xe3\xc0p\x00\xa1f\x19\xe1\r\x00\x00\x00\x10%J0\x031\xd8H\xbeP\x03A\xd0-\x8d\xcb\x18\x012$\xd8\x04\x98\x01\x11\xf4\x98\x001pW@\xd8\x02\xb18\x1b\xb0H\x0e\x00\x00\x00 \xa5\x8b\xd0\x02A\xf8\xde\x07\x91H\x001\x9f\xf5\xe8\xa0\x01!\xd2\x80\xf8\x00A\x98\xb6\xeb/0\x021l8\xf2\x90\x011m\xb1\x0e0\x021\xa5\xee\xa3\x80\x011\xa4{\x81 \x001\xc6C\xc4\x10\x04!e\xa9\x08\x011\xa0jQ\xa0\x01A\xb8\xa8cdX\x021q\xb4\xa5\x88\x031\\}\n\xa0\x011\xf2\xbf\xe6\x90\x03!\xbbLX\x021@"p\xa0\x03\xc1\xa8\xf7\x11"\x0e\x00\x00\x00\xf8Em\xe20\x001\xb0M\xe6h\x03!{\xf2\xb0\x00A\x009\x9a\xb0\xf8\x00!%\xbaP\x021@$\x88\xe8\x03\xb10\xbb\x97\x00\x0e\x00\x00\x00\xd0\x1d#H\x031\x88\xfbB\x98\x01A\xa0\xe0\xa3J0\x01!f\xe5\xe0\x011\x98\xea\x05\xd8\x011\xb0\x18U\xd0\x001\x88}\xe5\x08\x001\xc8!UP\x001hY\rH\x001\x98[\x1e\xc0\x011\xb0\xd1\x10\xc0\x00A\xe0\xae\x8c\x1c\xf0\x011\xa1\x11\x80\x10\x04!\xed\xa0\xe8\x03\xc1\xb8\x9d?R\x0e\x00\x00\x00\xb85\xe6\xc3\xe0\x011\x98\x06\xf8@\x021\x1dS!\xc8\x031\xfeQ\xa0\xb8\x02!\xb7Yh\x011\xc0Oj\xe0\x031\xe8E]\xf8\x001\x90\xb8x\xc0\x03A`;\xc0\xbe@\x01!\x14\x9a\x90\x001\xb0\xc2=@\x031\xa0\x1ff\xc8\x00\xc1\xd8\xaa6=\x0e\x00\x00\x00\x10\x14\x94\xc1x\x01!\xf9L\xa0\x01\xc1\xf8`\xa1\xe3\r\x00\x00\x00\xb0[X\x01p\x03!4A\x10\x01A\xa8\xb3\xa0\x13\xa8\x05!B\xcf\xf0\x041\xf0\x17Wp\x05AX\xe2\x18\x9f@\x001\x9b\xfb#p\x031 \x1e\x15\x88\x031\xab\xbf\xaf\x88\x03!\x8aZH\x001\xd8\xfeU\x90\x011 \xf3T\x18\x051\xe0q\xad\x98\x001\x98T\xc8 \x01A\x90\xbb7\xd8\xb0\x00!\xcfM\xa8\x02A@\xf8\x1b\x1bP\x00!\x05)x\x021x\xdc\xbcP\x011\x80\xe7\x02\xc8\x01\xf1\x1ch|\x95\xef,\x0f\x00\x00\xc8!\x81T"\x00\x00\x00\x18\xbb,(\x1e\x00\x00\x00\xf8Qh\x1b\x0f\x00\x00\x00\x18\xd0\xb8\xc5\x0c\x00\x00\x00\x80\xa6\x17\x10\x0420r)@\x00\xf1\x0b\x03s[\x17\x00\x00\x00\xf8\xd4\x0b\xd7\x0e\x00\x00\x00\xf8\xb4\x00\xc3\x0c\x00\x00\x00\xf8\x86. \x00A(=\x8a4x\x001\x8c\xff\xae0\x02!\x00\xb6`\x021\xf0\x19T\xf0\x02A\xa8X-A\xd0\x051\xdeK\x11\x18\x061\x08\xb2\xef(\x001\xb5\x83\xfex\x00\xa1\xd6\x12\xa8\x0b\x00\x00\x00\x88\xa6\x8dP\x001\xc8\xadoh\x031\xf0\x93\'\xb0\x0110\xc5U\x10\x03A\xe8KZ\x18@\x00!\xca\xf2\xf8\x00A\x18uh\xfc\x90\x03\xa1\xb6\x98\x1f\x0e\x00\x00\x00\x00\x03F\x18\x04A\xb0pw\xdc(\x03!\x0b\xbf\x80\x051\xe0=\x02`\x04A\x98>H\x92\xd8\x03!u\xdc\x80\x051\x00J\x8ch\x001H\xed\x96@\x02A\x18\xcdA\x8a\x00\x07\xf1\x0bS\xc4\xd3\x1b\x00\x00\x00\x88,\x9fAb\x03\x00\x00\xc0\xa4\x95\x11\x1c\x00\x00\x000\x8b\xbf8\x06"(u\xd8\x01A\x98v\xb8\\h\x02\xa1\x8e-{\r\x00\x00\x00(\x0b\x83x\x071\x08\xb1\x97\xe8\x051\xb0\x82I\x90\x07A\xf8\x0f\x08\x1ep\x03!H\x95\xb0\x021p\x991@\x041\xa8\xa9\xad\xb8\x001\xe8{[\xd0\x00A@\xa1\x95\xd5\xd8\x021=7\x93\xd0\x001K\x01L\x18\x07!\xfa\xe4@\x0018Nw\x00\x03AH\xd3\xb5\x99X\x07!\x0f\xa2h\x0118b|\xd0\x04\xb1\xd8\xa8:\xf0\r\x00\x00\x00\xf0\xe4\x9a\x88\x041\xd0\xfc) \x001\x88\x1e3\x10\x001PN\x7f\xa8\x021\x88\x9f8@\x021\x80\x85q\x00\x031\xb8H=8\x001\xe0W\xaf\x90\x021\x10\xb5\xf8P\x061\xd0\x1fLp\x021\xc0\xc9\x91(\x051\xb8\xb6H\x08\x001\xa0\xf3u@\x011\xc80>\x80\x011\x18\x06Vp\x041\x00\xd7\x05\x10\x001\x98\xe9?P\x0318\x88\xd7P\x031\x18\xac\xb6\xa0\x001@v\xc1 \x001\xc8\x8a\xb8\x90\x001p)\xd6x\x001\x983\xd0\xa8\x001P\x1d\x9b0\x011\x80~\xbd \x051`\xa7c\xb8\x011XsG\x18\x001\x18kX\x08\x00\xb1\x88\xedV\xe4\r\x00\x00\x00\xa0\x14\x93p\x011\xb8\xf0VX\x00\xb1\xd0\x1d\xeb\x1d\x0e\x00\x00\x00\xa0\xcb\\h\x011(\x8a\xb9h\x02\xf0\xff\xff\xff\xff\xff\xff\xff\xff\xffZ\xb8\xe6\x01\xc4\xdd\x11\x13@\x9dAD\xb2\x96\xd3\x12@\xf7D\r\xa2\x1c!\x13@\x8b0\xa6R\x1eO\x12@$\xac\xeb8\xb4\xc9\x12@\x15#>\x06\x97\x9c\x12@L\xc6\xaa;7\x86\x12@ n\x0e\x9e\xc8\xfe\x12@\xdc\xa3u\xa6>\x89\x12@b\x16\xa4\x0e6w\x12@2\xe6^X\xeb\xd3\x12@\x94\x8c57sS\x12@\x00\xf0\xe7\x98\xe6U\x13@\xe3\x9be\x03@\x9e\x12@\xe0}\xe2O\x0be\x12@l\xe1o\xfbxw\x12@$i=\x81\xcd`\x12@\xbe\x0b\x19\x9b%\xcc\x12@^\xa2\xfa\x87\x1eQ\x12@[\xe6\xd1\x06\xd9Q\x12@\xf3o\x18&}C\x12@Vi@v\x138\x12@\x03\xea\xab\x0eH\xc5\x12@b\xce\xedi\x89R\x12@F\xfc\x87i.\x93\x12@3\x0e\x11v\x8c\xc8\x12@\xd2\xfa\xcf\xcfn\x96\x12@\xf3*%\t\x08\xbb\x12@\xa9\x9e\xa9\x98\x1cZ\x12@]\xec|H\xd2E\x12@\xa8\x105r\xa4\xc8\x12@\x02a\x8f\xf9r\xda\x12@\xacI\x0eJ~\xad\x12@o\x8aw_\xddm\x12@Y\xb0\xa0\xae\xe4\x1f\x13@\xech\xa9\xc6\xcc\\\x12@\x08+\x0cD\x87V\x12@c\xa0C\x07\x7f\xd6\x12@M\x8c\xcbNo\x99\x12@o/\x8b\x8f\x05.\x12@zd}<\x89\xbd\x12@.\x0b\xdf\xd57`\x12@\x11\xd1^\xb2\xba\x04\x13@\x0c\x18\x84l\xeez\x12@\x87\xc2\xfe:\xa6\x9c\x12@\xa3>Lt%\xbb\x12@\xa6w3\xf2\x08x\x12@\x88\xb4\xc7\x15S\x03\x13@\xe0I\x98\xd6\xeaN\x12@7{;=\x0eD\x12@f`\xa8\xfbi\xd0\x12@\xb6\x11|s\x0f\xc5\x12@\xb7\xabi\xff \x91\x12@\x8c\x9b\xe5\xbc5\xc1\xc3? \xaev\xca\xaa\x9c\x13@\xac\xf9\x83K~v\x13@(+m\xe9\xe0\xe5\x14@\xde\x19\xb8\x16\xa2\xcc\x14@\x97\x9e\x9b\x8a\x9aX\x14@\xe6\x8e?-\x8bC\x14@\xf3|\x1d/\x07\x02\x14@a^p\xf2\\\xc2\x13@X\xe4i\xa72\xe0\x14@\xe0\xf4KG\xcc\x84\x15@B\xd3x\x99`\xd1\x12@n\x9b\x05R\xd9\x8b\x13@Z9\xdffZ\xfe\x12@\nE,\n\xc8\x91\x13@\x86S\xf3l\xd1\xf2\x13@dT\xf2d]\xb7\x12@l\xb1\xa8\xf9\xc2\xd3\x12@\x96\x18\x0f\x06\x97\xb1\x13@\xa7\xa8Q\x8d\x1b\x80\x13@K\'\x97\xb0\xe8\x0f\x15@S\xef\'\xdc\xb4\x15\x14@\xbdV\xec\x8c\xb9\x80\x14@\xc1V\x0c\xe1+Y\x15@H!\xe6\xfe\xe2B\x16@\x1c\xbc\xbe\x05\xb7\x1c\x16@*\x94\x97\x89G\xa1\x16@\x84\xb4TL\x85\xcc\x13@\x00\xc0V\xcf\x1e3\x13@\xa1\xa9>]\x95\xcf\x13@<\xc3]\xa7|\x7f\x13@\x04\xffl\x13\xf0_\x13@\x04\x9cV\xfe5\x96\x15@hC\x0b\xb1t\n\x16@??\x1e\xcb\'\x11\x16@\x8c;8\'Ae\x14@-\xef\xa3\'\xdd\x06\x14@\xa9\xab\x94\x90*J\x13@\xaf\x0f\x80H\xce\x07\x14@\x17\x06\xb8\xba\xff\xbd\x15@\xe5=\xaa{O\x98\x14@\x98\x8a\xe8\xbc\xe2\xeb\x13@e\xd9^\xf6g&\x13@\x9c\x1dp\xdd\xdb\x91\x13@\xb5zPr\x0b\n\x14@\xf9\xad\xec\x8a\xd19\x16@\x94&\x05b\xa6\xa7\x13@\xb2SD\xf4\xdf\xfd\x12@d\xd3u\x1d\xb4\xed\x12@\xb5]\xd5\xd0Q\xd4\x14@\xc7\xc4\x98\xb52\x9e\x15@5\x93n\x071\xab\x14@\x13\xcc\xd8\xa9A\x17\x13@k\x8c\xba\x93\xdf(\x14@\x83{3W\x96\x1d\x15@G\x04\x1d\x13^\x94\x13@1Xg\xe9$\x9f\x14@6\x8a\x9c\x13\xce\xdf\x13@\x11j\x01\xc9Yv\x14@tWnR\x0f\xd4\x12@\x141\xdd\x1a\xc8\x92\x14@TP\x0c\xf8\xf6\x8c\x13@K\xe7J\x1c\x8f{\x15@\x7f\x8ag\'\x82\x9e\x13@U\xfat\x83\xfex\x14@\xba\x90a\x15\xed\xe7\x13@,\xd0\x0f\xd1;\x0f\x15@\xae\xb0\xac\x9a\xc8g\x15@fpi\x83\xb8\xda\x15@\xad\x00Q\x81\xaa\xeb\x15@\xad(\x83\xbd\x9cX\x16@7\xb5\x92\x02(\xba\x14@\x98\x96\xff?\xb6\xe3\x12@\x16\x9c\x08\xeb\xdb\x08\x13@\xbb\xa4\xc3\xb1@\x04\x14@\x86u\xab\xfc\x1au\x14@\xd3\xb2g\r1\x1d\x14@\x8a\xfc\x1b\xa3\x10&\x13@C\x8d\xa4e\xbc\x86\x12@\xc9\x85-\xa0?\xcf\x14@E\x87k\x9a]\xe7\x15@]\x01\xdbc\xcd\x0f\x16@$\x9e\xb05r\x98\x13@2\x18*\xebV\xbf\x12@\xdf\xe0\t(\x81\x85\x11@4[y\x05\x82D\x11@\xa1\x0f\x00\xdff\x1e\x14@\xb2\x9e\xd9Jv\x9b\x13@\xb4x\xcc\xee0\x10\x14@|\x0ez\xdc\xe6m\x14@\x1c\xdd\xca\xbel\xa2\x14@\x10\xdb\xb8\x8eS\x0e\x14@\x90\x19vm\xa3x\x13@\x88o\x0c\x92\xa4_\x13@\x88\xe7\x8a\xc0\xc2s\x13@\x00\xfb\'\x8a+<\x14@\xe2\xb7\x07\x19P0\x15@\xb1\xd2\xed\x1f\x10R\x13@\xd3v\xa0=\x8aE\x13@\x08+\xad\x041\xdf\x15@\x02H\xed\x13\xe2\xd0\x15@\xf5\xc2\x9c\x11\xf5$\x15@*\xd3X\xe9o\xce\x14@\xfd\'.\xab\xa0\xd4\x15@\x13\xda\x11\xa5*\x1b\x16@\x0f\x07B\x1d+\x8d\x15@\\\xec\xeel\xc3\xe6\x14@\xc1\x1a$\x042\x19\x15@>e\x8bc.\xbd\x13@\xca%KQs\xf5\x12@\x82\xf6A\x1d\xb6.\x13@J?\xa5e\x8eP\x12@C\x9a\xaa\x0c\xd4\x7f\x10@\xd7\xae\xffx\xac\xef\x11@\x9c\x13@\x03\x13\xe1\x9eC\xb2\x12@\xa5\xc0\x14?\x00\x1e\x13@+\xf9\x02\x02\'\xed\x12@9\xd4\xacv\xbc\xf7\x12@\xa1\xfeK\x80\x8e\x17\x13@\xe8\x81\xbe\xe7\x00\xdc\x12@\x7f\x0e\xa4\xdaj\xc6\x12@n=\xd2;\xb3\xf3\x12@!\xc5\x923\t\xdd\x12@\r\x8bw\x00&\xca\x12@\x84\x11\xbe?\xb4P\x12@7\xe1:\x90<\xfe\x12@\xf0H\x1f\xc2\xda\x98\x12@\x83E\x89\xba\x05]\x13@\xb6X,o\xf3\xfa\x12@2\x81\xab\x18+\xfc\x12@\t\xa1\xd5C\xa4\xd1\x12@\xc4\x7f}\xe6#\xdf\x12@\xff\xf2\x1d\xac\xc3(\x13@Q$\tmq\xe5\x12@\x9e\xdd\xf4\xf2M\x8e\x12@:\xf8?W\xc7\x1a\x13@\x86\xb0\xd9\xce<\xf7\x12@`#\x92\xf6\x1az\x13@v8\x8cTK\n\x13@\x89\x12F\xf4\x92\x89\x13@\x13\xc1\xad\x14mB\x14@\xb0\x89D\x93\xca\xa01@\x86\x07\xf5\x18|\xd1\x11@m\xed\xf4>\x1fX\x12@Nn\x19\xb1\x8a\xf0\x11@\x98(\x1a\x85\x06\x80\x11@o\xcc\x93I\t\x0b\x12@\xc2\xd1\xa7\xe4\x1bX\x12@+\x83l\xca\xea\xa9\x11@\xd0\xc2\x1b\x14as\x12@\xa5\xbe\xc4{N\x89\x12@5\xa5BN\x02\x03\x12@2\xbey\xfcW\x18\x12@\xc4\xe1\xc8\xef\xd1q\x12@<(\xce8O\x1b\x12@\xbe\x92\x98\xb9\x1d\xd3\x11@\x8dj\x8f\xd8\xc0)\x12@\xf8o\xe0M\xd5\x12\x12@\xee\xc8\x8c\x06\x16\x0b\x12@\xff\xfcf\x15\x02\xb1\x12@\xb8\xc6N\xfc\xe1K\x12@\xf2,\xa8\x07t\x9c\x11@\xdf\xc4\x8e\xaf; \x12@t\xf7\x12Iu\xcd\x11@~\xc8\x06@\xc7%\x12@K\xe42O\n\xd7\x11@z\x02\x0faJ\x06\x12@4$$\xa8\xf7`\x12@`\xc0\x85X\xf0T\x12@\xfbr6j]\x1a\x12@\x88\xeb(\xb1Q\x8b\x12@\x82[\xd1\xb3\nM\x12@\xe5M\xa4\x1d~.\x12@\x01\x15\xf2\xf4\xa0\\\x11@\xb2\xd8#\x1bh\xb6\x11@9\x80\x85\xc6\xa4S\x12@\xd5\x15\xd1\xec\xda}\x11@-\x80\x10w@\xfd\r@\x8d\xce\x19y\xfbL\x12@\xcaN\xa4\xa2\x9c\xa7\x10@qV\x1f\x19\xfb\xb4\x10@\x88\x92\xb3\xb6\xa6@\x11@\xfe"\x1e\xacyW\x10@\x9f\x9b\x8d\x07\xb6\x99\x10@\x80m\x0b\x13\xec<\x12@\xa1\xact(\xdcK\x12@_\xea\x05$)\xe2\x11@\xd3d\xd6y\x1f"\x11@R\x86\x08\x124\x05\x11@p\xc5\x98s\x9eT\x11@\x10\xbe\x92\xc8\x18\xfd\x12@\xb8>\x06\xc80"\x12@O\xc7\x06p)]\x12@\x1d\xd8?N\t\x92\x11@\xe3WV\xdaq\x92\x11@\x91%\xf64@\xdc\x11@\xc4\xaf\xfd\xbb\x01\xad\x11@\xac\xd9~\xf2\x91[\x11@\xcf\xb7G\xe3S\xbc\x11@\x18\xe7\x9c\xbaNp\x12@\x82O\xc9/\x1b4\x12@~\xdd\xbd\x01\x9b,\x12@@\xe5?]\x0f\x0e\x12@\x1f\xb9\x96~\x16\xd8\x11@w\xf4p\xec\x10u\x11@\xb0(\x0exD\xd6\x11@\xa67 \x05\xa5\xa0\x11@\x9c]\x15\x19\xafr\x11@,;u\x92op\x11@\x13\xfc~\x03T\xfb\x11@\xb2S\x14\xe9\xc8:\x13@\xf75\xb5\x83\xc4\xc3\x12@\xad\x1dR\x100\xba\x10@\xa2\x14F\xf5\x84\xcb\x11@/\xb0-\xbbYp\x12@y:\xc3\x83\n.\x12@:\x12J\xe0B\x9b\x11@\xfc(`G.\xfb\x11@\x1c7\xb2Y\xb0V\x12@\x1f\xdek\x87\x1b\xaf\x11@\x95\x99\x17o&\xde\x11@\x18\xa6\xf9z1\xe9\x11@\xac\x02\xb58\\c\x11@\x81\xaf\xcd\x1a\xb6\x1a\x12@X4\x90\xeb\xeb\xe6\x12@\x86\x91?\x12b\xcc\x11@R`\x8b\xab\x08\xf7\x12@\x19|\xb1v\xf8O\x12@g\xe0r1UU\x12@\xbb\xea\xf4\x12\x95\xaa\x11@l\xcfUm\xff*\x12@\x86!E\xb6\xdf~\x12@j\xf4\xec\x1e?\xa5\x12@\x9ePAF\xe5\xe0\x11@Y\xbc\xf5\xeb\x15l\x13@\x84f\xe28\xd5\xe8\x11@'
86400.0
(Pdb) p back_window
0
4800
(Pdb) p cls._SERIALIZATION_TIMESTAMP_VALUE_LEN
16
(Pdb) p nb_points
300
(Pdb) p nb_points*cls._SERIALIZATION_TIMESTAMP_LEN
2400
(Pdb) p timestamps_raw
'\xc0\x96\'g\xa8^&\x15\x90\xa9\x8f2\x0e\x00\x00\x00@\xb0+\xc7\r\x00\x00\x00\x88I\x05\xfd\r\x00\x00\x000\xab\x94\xfa\r\x00\x00\x00\xe0\xd1\x08\xf6\r\x00\x00\x000D\x82-\x0e\x00\x00\x00X\xce\x84\xd3\r\x00\x00\x00\xd8\x8c\x04\xde\r\x00\x00\x00\xf8\xd3x\xf8\r\x00\x00\x00 \xcf\xa8\xff\r\x00\x00\x00p\x05\xc6G\x0e\x00\x00\x00(\xc3\x89\xeb\r\x00\x00\x00\xf8\xd7\xc2\xb4\r\x00\x00\x00x\xf0N\xf9\r\x00\x00\x00\xe0\xf0\xd38\x0e\x00\x00\x00H\xd5l0\x0e\x00\x00\x00(\xa4X\xb9\r\x00\x00\x00\x805i\xba\r\x00\x00\x00h\xc7\xef\xfa\r\x00\x00\x00\xa0\x8b\xed\x05\x0e\x00\x00\x00x#t\xe7\r\x00\x00\x00\xe0\x12G\x17\x0e\x00\x00\x00\xc8\xd7b\xe0\r\x00\x00\x000\'\x1b\xfd\r\x00\x00\x00H[\xbf\xee\r\x00\x00\x00`Y|\x07\x0e\x00\x00\x00H\xc9\x12\xec\r\x00\x00\x00\x18-\xa4\xf4\r\x00\x00\x00\x90\r\x17\xf7\r\x00\x00\x00\x88\xec^\xfb\r\x00\x00\x00\xd0\xb9\xbf \x0e\x00\x00\x00\x88\xb1\xde\xcf\r\x00\x00\x00\xa8\x87~\x0c\x0e\x00\x00\x00\x18\xaea\x06\x0e\x00\x00\x00\x98@\x9d\xe5\r\x00\x00\x00@\xf1]\xea\r\x00\x00\x00\x08\x97\xbe\xfd\r\x00\x00\x00\xd8\xae8\x05\x0e\x00\x00\x00\xb0\xb0$\xef\r\x00\x00\x00h3\xa8\x03\x0e\x00\x00\x00\xe0\xf0\xf3\t\x0e\x00\x00\x00\xe8D2\xcf\r\x00\x00\x00xSv\x0f\x0e\x00\x00\x00h\xda:)\x0e\x00\x00\x00\xa0\xeb\xfc\xeb\r\x00\x00\x00X\t\x1f\xd1\r\x00\x00\x00\xa0\xbc\xfe\'\x0e\x00\x00\x00\x08\xa2\x15\xc9\r\x00\x00\x00@,c\xeb\r\x00\x00\x00\xb8`\x98\xf5\r\x00\x00\x00\x98:V\xf1\r\x00\x00\x00\xd0Q~\x0b\x0e\x00\x00\x00x\xdch\'(\x02\x00\x00\xb8\x03\xf2\x11\t\x00\x00\x00xJ\xba\xbb\r\x00\x00\x00@f\xf7+\x0e\x00\x00\x00\xa0\xb5&\xa8\r\x00\x00\x00\xe0\xd1\x98\xde\r\x00\x00\x00\xd0\x14_?\x0e\x00\x00\x00\x18\x18H\xbb\r\x00\x00\x00\xe0v\x86\xe7\r\x00\x00\x00\x10\xe8f$\x0e\x00\x00\x00\xd8\x05w\xd9\r\x00\x00\x00(\xd5\xe3\x1a\x0e\x00\x00\x00\x88\xe2JK\x0e\x00\x00\x00h\t\xd5\xd3\r\x00\x00\x00\xd8\xe2\x93\xa8\r\x00\x00\x00PE\x9b\xe9\r\x00\x00\x00x\xff\xcc\xee\r\x00\x00\x00\xb8\xfe\xc1K\x0e\x00\x00\x00\xe0:\xf1\xc2\r\x00\x00\x00(\xc1\xa2\xd9\r\x00\x00\x00\x80\x15\xf7<\x0e\x00\x00\x00P\xaf\x91\xc5\r\x00\x00\x00`3\xdb\x14\x0e\x00\x00\x00\x18`\x99\xea\r\x00\x00\x00\x88\xcc\xda\x03\x0e\x00\x00\x00\xc0\xecZ\xdb\r\x00\x00\x00\xc017(\x0e\x00\x00\x00\xc8\xc7N\xc8\r\x00\x00\x00H%\xc1\x04\x0e\x00\x00\x000\xdfP\xf6\r\x00\x00\x00p\x9d\xc2\xfe\r\x00\x00\x008h>\t\x0e\x00\x00\x00\xd8\xf1a\xe4\r\x00\x00\x00\xe0]\x1a\x12\x0e\x00\x00\x00xA\xcf\xd7\r\x00\x00\x00P\xa0_\xed\r\x00\x00\x00\x00\xf9L\x0b\x0e\x00\x00\x00\x80\x16r%\x0e\x00\x00\x00\x90u\x07\xdb\r\x00\x00\x00\xc8<\xe4\xe0\r\x00\x00\x008D\'\xf9\r\x00\x00\x00\xa8\nZ\x12\x0e\x00\x00\x00\x00\xfbB\xdc\r\x00\x00\x00 \xda\xfc\t\x0e\x00\x00\x00\xd8\xb9F\xf1\r\x00\x00\x00(\xea\x06\x1f\x0e\x00\x00\x00p\xe0\xe6\xc9\r\x00\x00\x00\xc8Oe\x06\x0e\x00\x00\x00x\xb0/\xf9\r\x00\x00\x00\xe8\x84\xae\xfe\r\x00\x00\x00h\xcdz7\x0e\x00\x00\x00\xb0|\xda\xe0\r\x00\x00\x00\xf8\x88H\xce\r\x00\x00\x00(\xae\x9b\xf3\r\x00\x00\x00\xd0\xc4\xfe\xef\r\x00\x00\x00P_0\x08\x0e\x00\x00\x00\xf0Tf\xdd\r\x00\x00\x00\xa0{\xeb\xea\r\x00\x00\x00\xb0a\n\xf9\r\x00\x00\x00h\xb442\x0e\x00\x00\x00\x90\xb3\xac\x1f\x0e\x00\x00\x00\x18V\xf1\xab\r\x00\x00\x00\xd0Y\xd0\x0b\x0e\x00\x00\x008\x9d\xc8\xf4\r\x00\x00\x00\xb8\xe5\xf1\xdf\r\x00\x00\x00` \x159\x0e\x00\x00\x00\xf0\x80\xe3\xc0\r\x00\x00\x00(f\x19\xe1\r\x00\x00\x00\x10%J\xfa\r\x00\x00\x00\xd8H\xbe0\x0e\x00\x00\x00\xd0-\x8d\xcb\r\x00\x00\x00\x00$\xd8\x04\x0e\x00\x00\x00P\xaf\xf4\xf3\r\x00\x00\x00pW@\xe5\r\x00\x00\x008\x1b\xb0H\x0e\x00\x00\x00 \xa5\x8b\x05\x0e\x00\x00\x00\xf8\xde\x07\x91\r\x00\x00\x00\x10\x9f\xf5\xe8\r\x00\x00\x00\xc0\xd2\x80\x06\x0e\x00\x00\x00\x98\xb6\xeb/\x0e\x00\x00\x00\xd8l8\xf2\r\x00\x00\x008m\xb1\x0e\x0e\x00\x00\x00\x88\xa5\xee\xa3\r\x00\x00\x00P\xa4{\x81\x0e\x00\x00\x00\xd8\xc6C\xc4\r\x00\x00\x00\xd8e\xa9\xce\r\x00\x00\x00\xa0jQ\xd7\r\x00\x00\x00\xb8\xa8cd\x0e\x00\x00\x00hq\xb4\xa5\r\x00\x00\x00\x90\\}\n\x0e\x00\x00\x00\x90\xf2\xbf\xe6\r\x00\x00\x00\x88\xbbL\xee\r\x00\x00\x00@"p\xf7\r\x00\x00\x00\xa8\xf7\x11"\x0e\x00\x00\x00\xf8Em\xe2\r\x00\x00\x00\x90\xb0M\xe6\r\x00\x00\x00h{\xf2H\x0e\x00\x00\x00\x009\x9a\xb0\r\x00\x00\x00(%\xba\x03\x0e\x00\x00\x00@$\x88\xec\r\x00\x00\x000\xbb\x97\x00\x0e\x00\x00\x00\xd0\x1d#\xeb\r\x00\x00\x00\x88\xfbB\xe0\r\x00\x00\x00\xa0\xe0\xa3J\x0e\x00\x00\x00\xf0f\xe5\xf1\r\x00\x00\x00\x98\xea\x05\xc9\r\x00\x00\x00\xb0\x18U\xf2\r\x00\x00\x00\x88}\xe5\xf2\r\x00\x00\x00\xc8!U\x03\x0e\x00\x00\x00hY\r\x00\x0e\x00\x00\x00\x98[\x1e\xef\r\x00\x00\x00\xb0\xd1\x10d\x0e\x00\x00\x00\xe0\xae\x8c\x1c\x0e\x00\x00\x00\xb0\xa1\x11\x80\r\x00\x00\x00\x08\xed\xa0\xcf\r\x00\x00\x00\xb8\x9d?R\x0e\x00\x00\x00\xb85\xe6\xc3\r\x00\x00\x00\xa0\x98\x06\xf8\x0e\x00\x00\x00p\x1dS!\r\x00\x00\x00\x98\xfeQ\xa0\r\x00\x00\x00\xe0\xb7Y\x05\x0e\x00\x00\x00\xc0Oj\xf5\r\x00\x00\x00\xe8E]\xee\r\x00\x00\x00\x90\xb8x+\x0e\x00\x00\x00`;\xc0\xbe\r\x00\x00\x00\xd8\x14\x9a\xf2\r\x00\x00\x00\xb0\xc2=\x14\x0e\x00\x00\x00\xa0\x1ff\xe0\r\x00\x00\x00\xd8\xaa6=\x0e\x00\x00\x00\x10\x14\x94\xc1\r\x00\x00\x00P\xf9L\x06\x0e\x00\x00\x00\xf8`\xa1\xe3\r\x00\x00\x00\xb0[X\x01\x0e\x00\x00\x00\x184A\xec\r\x00\x00\x00\xa8\xb3\xa0\x13\x0e\x00\x00\x00XB\xcf\xfb\r\x00\x00\x00\xf0\x17W8\x0e\x00\x00\x00X\xe2\x18\x9f\r\x00\x00\x00P\x9b\xfb#\x0e\x00\x00\x000 \x1e\x15\x0e\x00\x00\x00\xc8\xab\xbf\xaf\r\x00\x00\x00H\x8aZ\x01\x0e\x00\x00\x00\xd8\xfeU\xf7\r\x00\x00\x00 \xf3T\x0c\x0e\x00\x00\x00\xe0q\xad\xf2\r\x00\x00\x00\x98T\xc8\x00\x0e\x00\x00\x00\x90\xbb7\xd8\r\x00\x00\x00\xd8\xcfM\x0b\x0e\x00\x00\x00@\xf8\x1b\x1b\x0e\x00\x00\x000\x05)\xcb\r\x00\x00\x00x\xdc\xbc\x03\x0e\x00\x00\x00\x80\xe7\x02\xe2\r\x00\x00\x00h|\x95\xef,\x0f\x00\x00\xc8!\x81T"\x00\x00\x00\x18\xbb,(\x1e\x00\x00\x00\xf8Qh\x1b\x0f\x00\x00\x00\x18\xd0\xb8\xc5\x0c\x00\x00\x00\x80\xa6\x17\xc8\r\x00\x00\x000r)\x03\x0e\x00\x00\x00\x80\x03s[\x17\x00\x00\x00\xf8\xd4\x0b\xd7\x0e\x00\x00\x00\xf8\xb4\x00\xc3\x0c\x00\x00\x00\xf8\x86.\x03\x0e\x00\x00\x00(=\x8a4\x0e\x00\x00\x000\x8c\xff\xae\r\x00\x00\x00\x90\x00\xb6\n\x0e\x00\x00\x00\xf0\x19T\xf3\r\x00\x00\x00\xa8X-A\x0e\x00\x00\x00\x98\xdeK\x11\x0e\x00\x00\x00H\x08\xb2\xef\r\x00\x00\x00\x90\xb5\x83\xfe\x0f\x00\x00\x00\x18\xd6\x12\xa8\x0b\x00\x00\x00\x88\xa6\x8d\x03\x0e\x00\x00\x00\xc8\xado\xdf\r\x00\x00\x00\xf0\x93\'\x05\x0e\x00\x00\x000\xc5U\xe8\r\x00\x00\x00\xe8KZ\x18\x0e\x00\x00\x00H\xca\xf2\xd8\r\x00\x00\x00\x18uh\xfc\r\x00\x00\x00`\xb6\x98\x1f\x0e\x00\x00\x00\x00\x03F\xfe\r\x00\x00\x00\xb0pw\xdc\r\x00\x00\x008\x0b\xbf?\x0e\x00\x00\x00\xe0=\x02\t\x0e\x00\x00\x00\x98>H\x92\r\x00\x00\x00\xd0u\xdc$\x0e\x00\x00\x00\x00J\x8c\xdf\r\x00\x00\x00H\xed\x96R\x0e\x00\x00\x00\x18\xcdA\x8a\r\x00\x00\x00\x80S\xc4\xd3\x1b\x00\x00\x00\x88,\x9fAb\x03\x00\x00\xc0\xa4\x95\x11\x1c\x00\x00\x000\x8b\xbf\xd1\r\x00\x00\x00(u\xa0\x13\x0e\x00\x00\x00\x98v\xb8\\\x0e\x00\x00\x00p\x8e-{\r\x00\x00\x00(\x0b\x83\xff\r\x00\x00\x00\x08\xb1\x97\xe7\r\x00\x00\x00\xb0\x82I\xf8\r\x00\x00\x00\xf8\x0f\x08\x1e\x0e\x00\x00\x00\x90H\x95\xcf\r\x00\x00\x00p\x9919\x0e\x00\x00\x00\xa8\xa9\xad\x1f\x0e\x00\x00\x00\xe8{[\xd8\r\x00\x00\x00@\xa1\x95\xd5\r\x00\x00\x00\x08=7\x93\x0e\x00\x00\x00\x00K\x01L\r\x00\x00\x00\xa8\xfa\xe4\x1e\x0e\x00\x00\x008Nw\x1c\x0e\x00\x00\x00H\xd3\xb5\x99\r\x00\x00\x00\x18\x0f\xa2\n\x0e\x00\x00\x008b|\xea\r\x00\x00\x00\xd8\xa8:\xf0\r\x00\x00\x00\xf0\xe4\x9a\xfa\r\x00\x00\x00\xd0\xfc)\n\x0e\x00\x00\x00\x88\x1e3\xfa\r\x00\x00\x00PN\x7f\xe3\r\x00\x00\x00\x88\x9f8\x00\x0e\x00\x00\x00\x80\x85q\xee\r\x00\x00\x00\xb8H=\xf0\r\x00\x00\x00\xe0W\xaf#\x0e\x00\x00\x00\x10\xb5\xf8\xd9\r\x00\x00\x00\xd0\x1fL\xf2\r\x00\x00\x00\xc0\xc9\x91\xf9\r\x00\x00\x00\xb8\xb6H\xf9\r\x00\x00\x00\xa0\xf3u$\x0e\x00\x00\x00\xc80>\xfc\r\x00\x00\x00\x18\x06V\xce\r\x00\x00\x00\x00\xd7\x05\xfc\r\x00\x00\x00\x98\xe9?+\x0e\x00\x00\x008\x88\xd7\xbe\r\x00\x00\x00\x18\xac\xb6\xea\r\x00\x00\x00@v\xc1\xfc\r\x00\x00\x00\xc8\x8a\xb8\xfa\r\x00\x00\x00p)\xd6\xf0\r\x00\x00\x00\x983\xd0\n\x0e\x00\x00\x00P\x1d\x9b\xf8\r\x00\x00\x00\x80~\xbd\xe5\r\x00\x00\x00`\xa7c\t\x0e\x00\x00\x00XsG\xf8\r\x00\x00\x00\x18kX\xf8\r\x00\x00\x00\x88\xedV\xe4\r\x00\x00\x00\xa0\x14\x93\xff\r\x00\x00\x00\xb8\xf0V\xfc\r\x00\x00\x00\xd0\x1d\xeb\x1d\x0e\x00\x00\x00\xa0\xcb\\\xcf\r\x00\x00\x00(\x8a\xb9\xef\r\x00\x00\x00'
array([1524009601289656000, 60977818000, 59176104000,
60079557000, 60038622000, 59962348000,
60893054000, 59383271000, 59559415000,
60003243000, 60123828000, 61333702000,
59786249000, 58867243000, 60017275000,
61082956000, 60941981000, 58944169000,
58962032000, 60044593000, 60228996000,
59717723000, 60520076000, 59599149000,
60080990000, 59840093000, 60255132000,
59795229000, 59938975000, 59980058000,
60051877000, 60678978000, 59322053000,
60339161000, 60236607000, 59686863000,
59766600000, 60091701000, 60217143000,
59846734000, 60190897000, 60296524000,
59310753000, 60388955000, 60821265000,
59793796000, 59343047000, 60800548000,
59208213000, 59783720000, 59954979000,
59883535000, 60322370000, 2371483131000,
38955779000, 58984123000, 60867176000,
58655684000, 59569132000, 61192738000,
58976639000, 59718924000, 60740266000,
59483031000, 60580681000, 61392741000,
59388529000, 58662839000, 59753842000,
59840987000, 61400547000, 59105164000,
59485897000, 61152368000, 59149234000,
60479452000, 59770495000, 60194213000,
59514744000, 60804248000, 59195181000,
60209309000, 59967070000, 60108742000,
60284627000, 59666199000, 60433260000,
59455259000, 59817042000, 60319136000,
60757776000, 59509274000, 59607629000,
60014675000, 60437433000, 59529952000,
60297108000, 59882519000, 60650089000,
59221926000, 60236845000, 60015227000,
60107425000, 61060337000, 59606990000,
59295435000, 59921641000, 59861026000,
60266930000, 59549046000, 59775876000,
60012782000, 60971857000, 60660954000,
58719295000, 60327746000, 59941363000,
59591747000, 61087228000, 59070710000,
59611113000, 60033738000, 60947319000,
59249602000, 60210816000, 59927474000,
59680774000, 61349043000, 60222580000,
58267787000, 59742986000, 60238648000,
60933519000, 59898359000, 60376051000,
58584901000, 62301906000, 59127351000,
59301783000, 59447012000, 61813795000,
58614641000, 60305530000, 59705914000,
59832581000, 59985896000, 60701145000,
59633387000, 59698426000, 61353393000,
58797472000, 60192073000, 59802920000,
60139486000, 59779522000, 59597061000,
61381796000, 59892918000, 59207183000,
59900238000, 59909701000, 60185453000,
60130417000, 59846319000, 61808366000,
60608524000, 57983214000, 59318005000,
61509443000, 59121219000, 64290724000,
56393670000, 58524303000, 60219308000,
59951960000, 59833665000, 60858874000,
59034844000, 59904759000, 60469134000,
59599364000, 61156535000, 59082282000,
60235250000, 59653579000, 60152110000,
59798271000, 60458841000, 60059239000,
61074774000, 58503783000, 60733234000,
60483838000, 58783149000, 60152253000,
59984183000, 60336436000, 59906028000,
60142671000, 59462106000, 60319191000,
60584360000, 59243038000, 60192251000,
59626416000, 16685672529000, 147446637000,
129523039000, 64884331000, 54856831000,
59191568000, 60182590000, 100318512000,
63737419000, 54811211000, 60182923000,
61011017000, 58770558000, 60309242000,
59916950000, 61223033000, 60419727000,
59855997000, 68694554000, 50064447000,
60189157000, 59583213000, 60216022000,
59732510000, 60538113000, 59474365000,
60069279000, 60659644000, 60100576000,
59533390000, 61199027000, 60280684000,
58288783000, 60747970000, 59585088000,
61515165000, 58154143000, 119516976000,
3720542629000, 120554104000, 59353566000,
60458825000, 61685135000, 57901158000,
60121353000, 59720053000, 60000142000,
60633387000, 59317242000, 61089094000,
60661017000, 59464449000, 59417928000,
62599413000, 57109728000, 60647865000,
60607123000, 58413405000, 60307935000,
59768595000, 59864951000, 60039030000,
60300066000, 60032229000, 59651346000,
60133253000, 59834992000, 59865123000,
60728236000, 59491530000, 59899650000,
60021656000, 60016867000, 60741252000,
60066509000, 59296319000, 60062816000,
60855151000, 59036371000, 59772415000,
60075112000, 60040973000, 59875142000,
60310959000, 60005490000, 59688976000,
60287068000, 60000007000, 60001119000,
59665477000, 60122404000, 60068131000,
60631490000, 59313540000, 59856489000], dtype=uint64)
<表示字节顺序,小端(最小有效字节存储在最小地址中)
uint64 Q, u8
这里实际转化为64位无符号整型类型
unserialize(cls, data, block_size, back_window):根据ceph中获得的监控数据(包含时间和值)的字符串
s1. 先解压数据,前面一半为时间,后面一半为时间对应的值
s2. 解压的时间由于采用差值,所以累加计算每个时间;
s3. 将时间列表,值列表来构建时间序列,然后根据block_size对序列计算出这个时间序列中最后一个数据,
在一天之前的起始时间,以该时间为基础,对此时间序列进行切片,得到最终需要处理的时间序列
s4. 用步骤s3的时间序列,block_size等实例化并返回最终需要处理的BoundTimeSerie
5 分析 ts.set_values: 计算聚合后的时间序列
6 分析_store_unaggregated_timeserie: 更新未聚合的时间序列
7 总结
gnocchi 3.1.4源码