从带时间戳的事件日志文件绘制系统负载
我有一个像这样的日志文件:
40624.4866625463#Event1
40624.4866623727#事件1
40624.4866623727#事件1
40624.4866625463#事件1
40624.4866625463#事件1
40624.4866627315#事件1
40624.4866627315#事件1
40624.4866627315#事件1
40624.4866627315#事件1
其中:
- 第一个数字是日期时间。 (整数是天数,小数是时间。)
#
是字段分隔符Event1
- 是事件的描述。
我想做的是绘制移动时间窗口内事件数量的图表。该窗口约为 15 秒,但必须易于更改。因此该图表将是事件发生率与时间的关系。
我想使用 gnuplot,但我愿意使用在 Windows 上运行的任何其他绘图工具。
非常感谢。
I have a log file like so:
40624.4866625463#Event1
40624.4866623727#Event1
40624.4866623727#Event1
40624.4866625463#Event1
40624.4866625463#Event1
40624.4866627315#Event1
40624.4866627315#Event1
40624.4866627315#Event1
40624.4866627315#Event1
Where:
- the first number is a date time. (Integer is the day number and fraction is the time.)
#
is the field delimeterEvent1
- is a description of the event.
What I would like to do is graph the number of events within a moving time window. The window will be around 15s but must be easily variable. So the graph will be rate of events versus time.
I would like to use gnuplot
but am open to using any other plotting tools that run on windows.
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不是 gnuplot 专家,但我认为你想要做的事情用 gnuplot 是不可能的,或者至少不是以一种简单的方式实现的。 gnuplot 需要一个包含数字的数据文件来相应地绘制它们。如果我理解正确的话,您会尝试总结任意时间段内的事件,并将该数字绘制在某个移动窗口中。
总结是 gnuplot 不支持的。可以调用 shell 命令,但我建议您使用您最喜欢的脚本语言并处理可用的数据。然后您可以将该数据导出到 gnuplot 可以处理的数据文件中。
编辑:
我刚刚遇到的另一个替代方案是Asymptote。我自己没有使用过它,但看起来它有很大的潜力。我肯定会在某个时间看一下它,在那之前也许你可以检查一下并报告它是多么容易上手;)
I am not a gnuplot expert, but I think what you are trying to do is not possible with gnuplot or at least not in a nice and easy way. What gnuplot needs is a data file containing numbers to plot them accordingly. If I understand you correctly, you try to sum up events through an arbitrary period of time and plot that number in some moving window.
The summing up is something that gnuplot does not support. It is possible to call shell commands but I would suggest you take your favorite scripting language and process the data you have available. Then you might export that data to a data file gnuplot can handle.
Edit:
An other alternative I just came across is Asymptote. I have not used it myself but it looks like it has a lot of potential. I'll definitely take a look at it some time, until then maybe you can check it out and report how easy it is to pick up ;)