Skip to content

Improve usage.json schema #110

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

Merged
merged 4 commits into from
Jul 29, 2024
Merged

Improve usage.json schema #110

merged 4 commits into from
Jul 29, 2024

Conversation

asmacdo
Copy link
Member

@asmacdo asmacdo commented Jun 22, 2024

Fixes #109

{
  "timestamp": "2024-06-22T12:05:35.337336-05:00",
  "num_samples": 1,
  "processes": {
    "1243562": {
      "pcpu": 0.0,
      "pmem": 0.0,
      "rss": 1760,
      "vsz": 221584,
      "timestamp": "2024-06-22T12:05:35.337336-05:00"
    }
  },
  "totals": {
    "pmem": 0.0,
    "pcpu": 0.0,
    "rss_kb": 1760,
    "vsz_kb": 221584
  },
  "averages": {
    "rss": 1760,
    "vsz": 221584,
    "pmem": 0.0,
    "pcpu": 0.0,
    "num_samples": 1
  }
}
{
  "timestamp": "2024-06-22T12:05:36.355308-05:00",
  "num_samples": 8,
  "processes": {
    "1243562": {
      "pcpu": 0.0,
      "pmem": 0.0,
      "rss": 1760,
      "vsz": 221584,
      "timestamp": "2024-06-22T12:05:36.355308-05:00"
    }
  },
  "totals": {
    "pmem": 0.0,
    "pcpu": 0.0,
    "rss_kb": 1760,
    "vsz_kb": 221584
  },
  "averages": {
    "rss": 1760.0,
    "vsz": 221584.0,
    "pmem": 0.0,
    "pcpu": 0.0,
    "num_samples": 8
  }
}

@asmacdo asmacdo marked this pull request as draft June 22, 2024 17:13
@asmacdo
Copy link
Member Author

asmacdo commented Jun 22, 2024

Marked as "draft" (and leaving the tests failing) until I'm done with #106 but review welcome

@asmacdo asmacdo added the semver-minor Increment the minor version when merged label Jul 25, 2024
@asmacdo asmacdo force-pushed the 109-usage-schema branch from f3b9b30 to 0b84eee Compare July 26, 2024 19:39
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.00%. Comparing base (25eb0f3) to head (80256d5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #110      +/-   ##
==========================================
- Coverage   93.60%   93.00%   -0.61%     
==========================================
  Files           2        2              
  Lines         344      343       -1     
  Branches       57       56       -1     
==========================================
- Hits          322      319       -3     
- Misses         16       18       +2     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@asmacdo asmacdo marked this pull request as ready for review July 26, 2024 19:52
@asmacdo asmacdo requested a review from yarikoptic July 26, 2024 19:52
@asmacdo
Copy link
Member Author

asmacdo commented Jul 26, 2024

to be merged (and hopefully auto-released) after #113

@asmacdo asmacdo added the release Create a release when this pr is merged label Jul 26, 2024
"rss_kb": self.total_rss,
"vsz_kb": self.total_vsz,
},
"averages": asdict(self.averages) if self.averages.num_samples >= 1 else {},
Copy link
Member

Choose a reason for hiding this comment

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

yes, this looks cleaner.

I guess unrelated -- what is "totals"? aren't they "max" through the time so we could see how much needed? Where is total wallclock run time (in seconds)? is there a way to get total cpu run time as well?

Copy link
Member Author

@asmacdo asmacdo Jul 29, 2024

Choose a reason for hiding this comment

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

"max through time" is not recorded in usage.json. The usage file contains nothing about the full run, it is only (aggregated) samples.

The "totals" in this case are total of all processes. ie, if the inner command forks and is running multiple processes simultaneously, the totals will report on the command as a whole, rather than per process.

The total wallclock run time is recorded in the info.json under execution_summary which should not be confused with the "totals" of a single sample. Since we are recording wall clock time and average cpu utilization, do we need cpu time? If so, lets file a separate issue.

info.json

{
  "command": "sleep 5",
  "system": {
    "uid": "austin",
    "memory_total": 33336778752,
    "cpu_total": 20
  },
  "env": {},
  "gpu": null,
  "duct_version": "0.0.1",
  "execution_summary": {
    "exit_code": 0,
    "command": "sleep 5",
    "logs_prefix": "ZZZZ_",
    "wall_clock_time": "5.003 sec",
    "peak_rss": "1920 KiB",
    "average_rss": "1920.000 KiB",
    "peak_vsz": "221584 KiB",
    "average_vsz": "221584.000 KiB",
    "peak_pmem": "0.0%",
    "average_pmem": "0.000%",
    "peak_pcpu": "0.0%",
    "average_pcpu": "0.000%",
    "num_samples": 4,
    "num_reports": 3
  }
}

@asmacdo asmacdo force-pushed the 109-usage-schema branch from dab5401 to 80256d5 Compare July 29, 2024 20:16
@asmacdo asmacdo merged commit fe18878 into con:main Jul 29, 2024
29 of 30 checks passed
@asmacdo asmacdo deleted the 109-usage-schema branch August 22, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Create a release when this pr is merged semver-minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve usage.json schema
2 participants