Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 310 #326

Closed
wants to merge 9 commits into from
Closed

Bug 310 #326

wants to merge 9 commits into from

Conversation

feng-tao
Copy link
Contributor

Fix for bug #310 . The fix is more like a hack. So please review if it is ok.

@@ -426,10 +427,20 @@ def _process_naarad_config(self, config, analysis):
naarad.utils.parse_basic_metric_options(config, section)
sar_metrics = naarad.utils.get_all_sar_objects(metrics, infile, hostname, output_directory, label, ts_start,
ts_end, None)
if sar_metric.ts_start is None and (sar_metric.ts_end is None or sar_metric.ts_end > ts_start):
sar_metric.ts_start = ts_start
if sar_metric.ts_end is None and (sar_metric.ts_start is None or ts_end > sar_metric.ts_start):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor but looks like extra space (2 spaces) between > sar_metric.ts_start

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks.

On Fri, Mar 27, 2015 at 10:39 AM, Richard Hsu [email protected]
wrote:

In src/naarad/init.py
#326 (comment):

@@ -426,10 +427,20 @@ def _process_naarad_config(self, config, analysis):
naarad.utils.parse_basic_metric_options(config, section)
sar_metrics = naarad.utils.get_all_sar_objects(metrics, infile, hostname, output_directory, label, ts_start,
ts_end, None)

  •      if sar_metric.ts_start is None and (sar_metric.ts_end is None or sar_metric.ts_end > ts_start):
    
  •        sar_metric.ts_start = ts_start
    
  •      if sar_metric.ts_end is None and (sar_metric.ts_start is None or ts_end >  sar_metric.ts_start):
    

Minor but looks like extra space (2 spaces) between > sar_metric.ts_start


Reply to this email directly or view it on GitHub
https://github.com/linkedin/naarad/pull/326/files#r27315032.

@richardhsu richardhsu mentioned this pull request Mar 27, 2015
@@ -675,6 +675,7 @@ def get_standardized_timestamp(timestamp, ts_format):
else:
dt_obj = datetime.datetime.strptime(timestamp, ts_format)
ts = calendar.timegm(dt_obj.utctimetuple())*1000 + dt_obj.microsecond/1000
ts = timestamp.replace(' ','_')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to play well with dygraphs (the report.html file when graphing with Javascript). The Matplotlib files look correct though!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is not what we want. This bypasses the conversion of a string timestamp to epoch milliseconds. We need the epoch milliseconds for comparison purposes otherwise we are comparing timestamp strings which won't be the correct comparison for comparing against ts_start and ts_end configurations.

@richardhsu
Copy link
Contributor

I did try tackling this at one point, and it's not the complete solution that I wanted.

As an overview all metric parsers will write to CSV files at the end and write timestamp,value per line of CSV where the timestamp is in epoch milliseconds and the value is just the metric value. I think that might be the best place to inject changing back to a readable timestamp format.

The only issue, I had was that it converts it to a datetime string format such as 2015-03-27 10:00:00 but it would be the pacific time zone rather than the UTC timezone. You can take a look at my attempt at doing this type of fix at richardhsu/naarad@1fea49f but feel free to take a different approach if you feel fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants