我刚刚开始使用rrdtool来坚持有关家庭自动化的价值观。 我写了一些样本来了解rdd的原理,但我恐怕没有得到它:
这就是我定义rrd数据库的方式:
<!-- Round Robin Database Dump -->
<rrd>
<version>0003</version>
<step>10</step> <!-- Seconds -->
<lastupdate>1023654220</lastupdate> <!-- 2002-06-09 22:23:40 CEST -->
<ds>
<name> test</name>
<type> GAUGE </type>
<minimal_heartbeat>20</minimal_heartbeat>
<min>0.000000000e+00</min>
<max>5.000000000e+00</max>
<!-- PDP Status -->
<last_ds>5</last_ds>
<value>0.000000000e+00</value>
<unknown_sec> 0 </unknown_sec>
</ds>
<!-- Round Robin Archives -->
<rra>
<cf>AVERAGE</cf>
<pdp_per_row>1</pdp_per_row> <!-- 10 seconds -->
<params>
<xff>5.000000000e-01</xff>
</params>
<cdp_prep>
<ds>
<primary_value>5.000000000e+00</primary_value>
<secondary_value>5.000000000e+00</secondary_value>
<value>NaN</value>
<unknown_datapoints>0</unknown_datapoints>
</ds>
</cdp_prep>
<database>
<!-- 2002-06-09 22:22:10 CEST / 1023654130 --> <row><v>NaN</v></row>
<!-- 2002-06-09 22:22:20 CEST / 1023654140 --> <row><v>NaN</v></row>
<!-- 2002-06-09 22:22:30 CEST / 1023654150 --> <row><v>NaN</v></row>
<!-- 2002-06-09 22:22:40 CEST / 1023654160 --> <row><v>NaN</v></row>
<!-- 2002-06-09 22:22:50 CEST / 1023654170 --> <row><v>3.000000000e+00</v></row>
<!-- 2002-06-09 22:23:00 CEST / 1023654180 --> <row><v>3.000000000e+00</v></row>
<!-- 2002-06-09 22:23:10 CEST / 1023654190 --> <row><v>4.000000000e+00</v></row>
<!-- 2002-06-09 22:23:20 CEST / 1023654200 --> <row><v>4.000000000e+00</v></row>
<!-- 2002-06-09 22:23:30 CEST / 1023654210 --> <row><v>5.000000000e+00</v></row>
<!-- 2002-06-09 22:23:40 CEST / 1023654220 --> <row><v>5.000000000e+00</v></row>
</database>
</rra>
</rrd>
这是我调用rddtool dump时的结果:
@hooks.register('register_rich_text_features')
def register_superscript_feature(features):
feature_name = 'superscript'
type_ = 'SUPERSCRIPT'
tag = 'sup'
# Configure how Draftail handles the feature in its toolbar.
control = {
'type': type_,
'label': 'x²',
'description': 'Superscript',
'style': 'vertical-align: super',
}
# Call register_editor_plugin to register the configuration for Draftail.
features.register_editor_plugin(
'draftail', feature_name, draftail_features.InlineStyleFeature(control)
)
# Configure the content transform from the DB to the editor and back.
db_conversion = {
'from_database_format': {tag: InlineStyleElementHandler(type_)},
'to_database_format': {'style_map': {type_: tag}},
}
# Call register_converter_rule to register the content transformation conversion.
features.register_converter_rule('contentstate', feature_name, db_conversion)
任何人都可以解释原因:
1)时间戳1023654121的存储值不见了?
2)时间戳1023654160的存储值不见了?
在理解rrd原理时我错过了什么? 在哪里可以找到关于这些主题的解释?
非常感谢!
卡斯滕