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

Add prmon version to the JSON output #176

Merged
merged 3 commits into from
Nov 10, 2020
Merged

Conversation

amete
Copy link
Collaborator

@amete amete commented Nov 9, 2020

Hi @graeme-a-stewart,

This is one way to proceed w/ adding the version number to the JSON. Actually, maybe we can tweak the CMakeLists.txt a bit to put the correct version of prmonVersion.h in a dedicated folder and add that to the include directories to make things a bit tidier but this should functionally work:

{
  "Avg": {
    "nprocs": 1.0,
    "nthreads": 1.0,
    "pss": 586.333,
    "rchar": 851.533,
    "read_bytes": 8376.0,
    "rss": 1376.0,
    "rx_bytes": 0.0,
    "rx_packets": 0.0,
    "swap": 0.0,
    "tx_bytes": 0.0,
    "tx_packets": 0.0,
    "vmem": 2516.0,
    "wchar": 0.0,
    "write_bytes": 0.0 
  },  
  "HW": {
    "cpu": {
      "CPUs": 4,
      "CoresPerSocket": 1,
      "ModelName": "Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz",
      "Sockets": 4,
      "ThreadsPerCore": 1
    },  
    "mem": {
      "MemTotal": 2038904
    }   
  },  
  "Max": {
    "nprocs": 1,
    "nthreads": 1,
    "pss": 589,
    "rchar": 4164,
    "read_bytes": 40960,
    "rss": 1376,
    "rx_bytes": 0,
    "rx_packets": 0,
    "stime": 0,
    "swap": 0,
    "tx_bytes": 0,
    "tx_packets": 0,
    "utime": 0,
    "vmem": 2516,
    "wchar": 0,
    "write_bytes": 0,
    "wtime": 4
  },  
  "Version": "2.1.1"
}

Please let me know what you think.

Best,
Serhan

Closes #175

@amete amete added the enhancement New feature or request label Nov 9, 2020
@graeme-a-stewart
Copy link
Member

Thanks @amete !

So would it be worth adding a new section for this data, i.e.,

metadata["prmon"]["version"] = @VERSION@

This would mean if we felt we needed to add anythign else from prmon itself in the future it would have a clear place to go.

package/src/prmon.cpp Outdated Show resolved Hide resolved
@amete
Copy link
Collaborator Author

amete commented Nov 10, 2020

Thanks a lot @graeme-a-stewart. Now we have a separate block for the metadata:

{
  ...
  "prmon": {
    "Version": "2.1.1"
  }
}

Indeed if we wish to add more meta data down the line, it would be cleaner to populate this dedicated section.

@graeme-a-stewart graeme-a-stewart added this to the v2.2 milestone Nov 10, 2020
@graeme-a-stewart graeme-a-stewart merged commit 8a12165 into master Nov 10, 2020
@graeme-a-stewart
Copy link
Member

Looks great - thanks @amete !

@amete amete mentioned this pull request Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add prmon version information
2 participants