I am a big fan of real-time metrics extraction based on the cumulative metrics: That is to say take a snapshot each second (default interval) from the cumulative metrics and computes the delta with the previous snapshot.
I build such tools for ASM metrics and for Exadata Cell metrics.
Recently, I added a new feature to the asm_metrics.pl script: The ability to display the average delta values since the collection began (Means since we launched the script).
Well, I just added this new feature to the exadata_metrics.pl script.
Of course the old features remain:
- You can choose the number of snapshots to display and the time to wait between the snapshots.
- You can choose to filter on name and objectname based on predicates (see the help).
- You can work on all the cells or a subset thanks to the CELL or the GROUPFILE parameter.
- You can decide the way to compute the metrics with no aggregation, aggregation on cell, objectname or both.
Let’s see the help:
./exadata_metrics.pl help
Usage: ./exadata_metrics.pl [Interval [Count]] [cell=|groupfile=] [display=] [show=] [top=] [name=] [name!=] [objectname=] [objectname!=]
Default Interval : 1 second.
Default Count : Unlimited
Parameter Comment Default
--------- ------- -------
CELL= comma-separated list of cells
GROUPFILE= file containing list of cells
SHOW= What to show (name included): cell,objectname ALL
DISPLAY= What to display: snap,avg (comma separated list) SNAP
TOP= Number of rows to display 10
NAME= ALL - Show all cumulative metrics (wildcard allowed) ALL
NAME!= Exclude cumulative metrics (wildcard allowed) EMPTY
OBJECTNAME= ALL - Show all objects (wildcard allowed) ALL
OBJECTNAME!= Exclude objects (wildcard allowed) EMPTY
utility assumes passwordless SSH from this cell node to the other cell nodes
utility assumes ORACLE_HOME has been set (with celladmin user for example)
Example : ./exadata_metrics.pl cell=cell
Example : ./exadata_metrics.pl groupfile=./cell_group
Example : ./exadata_metrics.pl groupfile=./cell_group show=name
Example : ./exadata_metrics.pl cell=cell objectname='CD_disk03_cell' name!='.*RQ_W.*'
Example : ./exadata_metrics.pl cell=cell name='.*BY.*' objectname='.*disk.*' name!='GD.*' objectname!='.*disk1.*'
The “display” option is the new one: It allows you to display the delta snap values (as previously), the average delta values since the collection began (that is to say since the script has been launched) or both.
Let’s see one example:
I want to extract real-time metrics from the %IO_TM_R% cumulative ones, for 2 cells and aggregate the results for all the cells and all the objectname (means I just want to show the metrics). I want to see each snapshots and the average since we launched the script.
So, I launch the script that way:
./exadata_metrics.pl cell=exacell1,exacell2 display=avg,snap name='.*IO_TM_R.*' show=name
It will produce this kind of output:
--------------------------------------
----------COLLECTING DATA-------------
--------------------------------------
......... SNAP FOR LAST COLLECTION TIME ...................
DELTA(s) CELL NAME OBJECTNAME VALUE
-------- ---- ---- ---------- -----
60 CD_IO_TM_R_LG 0.00 us
60 CD_IO_TM_R_SM 807269.00 us
......... AVG SINCE FIRST COLLECTION TIME...................
DELTA(s) CELL NAME OBJECTNAME VALUE
-------- ---- ---- ---------- -----
60 CD_IO_TM_R_LG 0.00 us
60 CD_IO_TM_R_SM 807269.00 us
So, no differences between the delta snap and the average after the first snap (which is obvious :-) ).
Into the “SNAP” section, the delta(s) field computes the delta in seconds of the collectionTime recorded into the snapshots (see this post for more details). Into the “AVG” section, the delta(s) field is the sum of the delta(s) field from all the previous “SNAP” sections.
Let’s have a look to the output after 2 minutes of metrics extraction to make things clear:
--------------------------------------
----------COLLECTING DATA-------------
--------------------------------------
......... SNAP FOR LAST COLLECTION TIME ...................
DELTA(s) CELL NAME OBJECTNAME VALUE
-------- ---- ---- ---------- -----
61 CD_IO_TM_R_LG 0.00 us
61 CD_IO_TM_R_SM 348479.00 us
......... AVG SINCE FIRST COLLECTION TIME...................
DELTA(s) CELL NAME OBJECTNAME VALUE
-------- ---- ---- ---------- -----
121 CD_IO_TM_R_LG 0.00 us
121 CD_IO_TM_R_SM 577874.00 us
So, during the last 61 seconds of collection the CD_IO_TM_R_SM metric delta value is 348479.00 us.
It leads to an average of 577874.00 us since the collection began (That is to say since 121 seconds of metrics collection).
Remarks:
- The exadata_metrics.pl script can be downloaded from this repository.
- The DELTA (s) field is an important one to interpret the result correctly, I strongly recommend to read this post for a better understanding of it.
Conclusion:
The exadata_metrics.pl now offers the ability to display the average delta values since the collection began (that is to say since the script has been launched).