-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
sar should detect compressed files and decompress #93
Comments
Good feature being able to easily read compressed files. How tricky would it be to make sar itself able to read compressed files natively by making use of zlib ? Would the various seek() backward calls make it impossible? |
The short-answer is: it's very easy to use zlib to open files. See http:https://www.zlib.net/manual.html#Gzip. But with zlib you only get zlib's inflate/deflate or gzip. It would be nice for the future to support opening xz files, and according to that project's faq page "liblzma is a compression library with an API similar to that of zlib." I suspect bzip2 is not on anyone's mind anymore, but I believe a library exists for this also. (I included it in the script for users who might be doing that on older systems). So we need a wrapper routine, a way to detect the file format, and then we get a filehandle to the uncompressed data. |
BTW: I know of two software packages that graph sar data, and both are very weak. One is java-based and craps out with large amounts of data; the other is php based and very very old and have not yet gotten it to work. Do you know of a good project that is doing this? Otherwise, I'd like to work on it. |
You can use sadf to get data in other formats and use graphing backends, I am also working in one: https://github.com/sanxiago/sargraphjs I built it On Feb 7, 2016 3:24 AM, "Otheus" [email protected] wrote:
|
FYI I'm currently working on a new output format for sadf: SVG, which will make it easy to get graphs using sysstat standard tools. Wrt file compression, I don't have any time left to work on this. If this feature was to be added to sysstat, it should actually handle compression within sar, depend on an external library (don't implement compression algorithms yourself), be configurable out (sysstat commands must be able to be compiled even if this library is not installed), and be almost transparent to existing code to avoid regressions. |
@sysstat Understood. I will try to find time to work on this. |
It's nice to see you added compression to older sar files. The feature is underdocumented and only partly supported. I'd like to help. I've written a wrapper to sar. See my repo here: https://github.com/otheus/sar-helper
Essentially, if sar is told (with -f) to use a file that is compressed, it tries to decompress it.
To me, this code should be within sar itself. I've forked the project. I await your comments on how to proceed.
The text was updated successfully, but these errors were encountered: