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 support for indexing SAR data into elasticsearch 1.7.x #176

Closed

Conversation

arcolife
Copy link
Collaborator

@arcolife arcolife commented Mar 1, 2016

w.r.t.: #227
This PR adds SAR data indexing capability to pbench. Details:

  1. index-pbench now calls a module - index-sar.
  2. Index name in ElasticSearch for pbench's indices, was modified to accommodate for SAR data mapping.
  3. All indexed data goes to pbench.sar-yyyy-mm-dd
  4. sar and pbench runs are connected by the md5 of the pbench run.
  • sar docs in ES have 2 fields from the pbench run:
    1. sar data hierarchy path (as _metadata.pbench_run_unique_id) depicting path to sar file in results
    2. pbench-run's md5 (as _metadata.pbench_run_md5 )

@arcolife
Copy link
Collaborator Author

arcolife commented Mar 1, 2016

okay it seems I forgot about the indexing unittests there. Shall see to that..

@arcolife arcolife self-assigned this Apr 22, 2016
@arcolife arcolife force-pushed the sar-index branch 6 times, most recently from ee372c4 to d383e7f Compare May 2, 2016 14:43
@arcolife arcolife changed the title add SAR indexing support; and grafana dashboard templates add SAR indexing support; and (WIP) grafana dashboard templates May 2, 2016
@arcolife arcolife force-pushed the sar-index branch 2 times, most recently from ee9caee to 28983fd Compare May 2, 2016 19:04
@arcolife arcolife changed the title add SAR indexing support; and (WIP) grafana dashboard templates add support for indexing SAR data into elasticsearch May 2, 2016
@arcolife
Copy link
Collaborator Author

arcolife commented May 2, 2016

Using this, a POST query made to _all indices (for example), in the following form:

{
  "query": {
    "multi_match": {
      "query": "2e2e8933451409eeda920ab6c35f7cde",
      "fields": [
        "_metadata.md5",
        "_metadata.pbench_run_md5"
      ]
    }
  },
  "from": 0,
  "size": 2,
  "fields": [
    "_metadata.file-name",
    "_metadata.nodename"
  ],
  "sort": [],
  "aggs": {}
}

..would result in :

...
"hits" : [ 
    {
      "_index" : "pbench.2015-10",
      "_type" : "pbench-run",
      "_id" : "2e2e8933451409eeda920ab6c35f7cde",
      "_score" : 3.925263,
      "fields" : {
        "_metadata.file-name" : [ "/var/lib/pbench-agent/benchserver2_sample_pbench_run_2015-10-11.tar.xz" ]
      }
    }, 
    {
      "_index" : "pbench.sar-2015-10-11",
      "_type" : "sar",
      "_id" : "cd703c87c70ea9fe623ce748b4af1ca1",
      "_score" : 2.7668054,
      "fields" : {
        "_metadata.nodename" : [ "benchserver2" ]
      }
    } 
]
...

@portante
Copy link
Member

@arcolife, can you rebase this commit?

@portante
Copy link
Member

And then add unit tests?

@arcolife
Copy link
Collaborator Author

rebased. will add the unit tests. Although, is https://travis-ci.org/distributed-system-analysis/pbench/jobs/145559700#L907 this related to this PR? I've faced this before.

@portante
Copy link
Member

@arcolife, I have seen that before, but I don't remember the root cause. We'll have to debug it.

@arcolife
Copy link
Collaborator Author

update: failure in pbench unit test [ref: https://github.com//pull/176#issuecomment-233359641 ] due to modification of index-pbench by this commit and consequently change in expected line numbers under pbench/bin/gold/test-*.txt (viz-a-viz test case output verification texts) ..and so the unittests:_verify_output() (code ref: https://github.com/distributed-system-analysis/pbench/blob/master/server/pbench/bin/unittests#L93 ) declares failed cases.

@arcolife
Copy link
Collaborator Author

arcolife commented Aug 5, 2016

WIP: unit test rework. reference: #303
will be adding a proper gold/test-9.txt and uncomment test-9 from bin/unittests
cc/ @portante

@arcolife
Copy link
Collaborator Author

arcolife commented Aug 5, 2016

test-9 (for this PR) fails at https://travis-ci.org/distributed-system-analysis/pbench/jobs/150102944#L784
..passes locally on laptop. A difference of time config on machines possibly an issue. Not sure.

@portante
Copy link
Member

portante commented Aug 9, 2016

@arcolife, I tried this out this morning, and this is due to your timezone. :( I think the sadf command needs to be invoked with TZ=UTC, I'll post a PR with a fix to your repo, so that you can pull that in adding it to this PR.

@portante
Copy link
Member

portante commented Aug 9, 2016

Okay, your branch need to be rebased on top of upstream master before we can work this through. Can you do that so I can send you a PR? @arcolife

@portante
Copy link
Member

portante commented Apr 5, 2017

Any further updates based on the comments made here so far, @arcolife?

@arcolife arcolife force-pushed the sar-index branch 2 times, most recently from 809f348 to 4dd7781 Compare April 18, 2017 16:34
@arcolife
Copy link
Collaborator Author

arcolife commented Apr 18, 2017

extractsa is now a python script extract_sa.py that handles various scenarios as per #176 (comment)

Usage:

 ./extract_sa.py -h
Usage: extract_sa.py [--config <path-to-pbench-index.cfg>] <path-to-sa-binary>

Options:
  -h, --help            show this help message and exit
  -c CFG_NAME, --config=CFG_NAME
                        Specify config file

Example usage (independent of pbench):

 $ PYTHONPATH=./:$PYTHONPATH ./satools/extract_sa.py -c ../lib/config/pbench-index.cfg.example ~/sar.data 

Total incompatibility when a required specific sadf script is not found:

Invalid system activity file: /home/arcolife/Documents/sar_samples/test/sa04_65_local
File created by sar/sadc from sysstat version 9.0.4
Current sysstat version cannot read the format of this file (0x1170)

Cannot convert the format of this file

compatible OS version for this binary: 65
Appropriate sadf-<type>-<arch> script necessary to process this file not found!
Please provide a path to folder containing sadf script corresponding to Red Hat OS: 65
Path should be configured under [SAR] section in ../lib/config/pbench-index.cfg.example

Total incompatibility but sadf script found to deal with this:

Invalid system activity file: /home/arcolife/Documents/sar_samples/test/sa04_65_local
File created by sar/sadc from sysstat version 9.0.4
Current sysstat version cannot read the format of this file (0x1170)

Cannot convert the format of this file

compatible OS version for this binary: 65

Nodename: local.example.com
XML data saved to: /home/arcolife/Documents/sar_samples/test/sa04_65_local.xml

Partial incompatibility, dealt with conversion:

 ./extract_sa.py -c ../lib/config/pbench-server.cfg.example ~/Documents/sar_samples/test/datafile001 
Invalid system activity file: /home/arcolife/Documents/sar_samples/test/datafile001
File created by sar/sadc from sysstat version 10.1.5
Current sysstat version cannot read the format of this file (0x2171)

file_magic: OK
file_header: OK
file_activity: A_CPU A_PCSW A_IRQ A_SWAP A_PAGE A_IO A_MEMORY A_HUGE A_KTABLES A_QUEUE A_DISK A_NET_DEV A_NET_EDEV A_NET_NFS A_NET_NFSD A_NET_SOCK A_NET_IP A_NET_EIP A_NET_ICMP A_NET_EICMP A_NET_TCP A_NET_ETCP A_NET_UDP A_NET_SOCK6 A_NET_IP6 A_NET_EIP6 A_NET_ICMP6 A_NET_EICMP6 A_NET_UDP6 A_PWR_CPUFREQ A_PWR_FAN A_PWR_TEMP A_PWR_IN A_PWR_USB OK
Statistics: .........................................................................................................................
File successfully converted to sysstat format version 11.2.0

converted binary to current version of sysstat..
None

Nodename: benchserver2
XML data saved to: /home/arcolife/Documents/sar_samples/test/datafile001.xml

Compatible versions:

 ./extract_sa.py -c ../lib/config/pbench-server.cfg.example ~/Documents/sar_samples/test/sa10 

Nodename: localhost.localdomain
XML data saved to: /home/arcolife/Documents/sar_samples/test/sa10.xml

@arcolife arcolife force-pushed the sar-index branch 3 times, most recently from 37309ab to 178a6cb Compare April 18, 2017 23:50
…pport

Add unit tests for sar ingress under 'test-11'; Also:
	- fix existing unit tests for this branch;
	- update line no.s for gold test 7.{3..5}. Refer distributed-system-analysis#303
	- update .gitignore: __pycache__ in any dir
	- cleanup sar-index code addition
@arcolife arcolife force-pushed the sar-index branch 3 times, most recently from d07261d to 1946ae7 Compare April 19, 2017 07:37
Also, update TODO tasks in extract_sa.py
@arcolife
Copy link
Collaborator Author

arcolife commented Apr 22, 2017

TODOs

Questions

  1. +# why are we using c_uint8 instead of the designated c_ubyte for representing unsigned char?
  2. Although 0x2173 works for fedora 22 / sysstat 11.1.2-3, but I've included 'f24' in class map, and corresponding sysstat package - 11.2.0 .. Is that the right thing to do (show latest compatibility) ?
# (Pdb) fh.dump(magic)
# file_header (0x2173):
# 	sa_ust_time 288 1970-01-01 00:04:48
# 	sa_last_cpu_nr 0
# 	sa_act_nr 0
# 	sa_vol_act_nr 0
# 	sa_day <sysstat.c_ubyte_Array_4 object at 0x7f433d5ae9d8>
# 	sa_month <sysstat.c_ubyte_Array_4 object at 0x7f433d5ae9d8>
# 	sa_year <sysstat.c_ubyte_Array_4 object at 0x7f433d5ae9d8>
# 	sa_sizeof_long b'\x00'
# 	sa_sysname b''
# 	sa_nodename b''
# 	sa_release b'ost.localdomain'
# 	sa_machine b'200.fc22.x86_64'  <------ This shows up in fh dump from a binary probably generated by fedora 22.

@portante
Copy link
Member

Replaced by #645.

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

Successfully merging this pull request may close these issues.

None yet

2 participants