Bug #46326 isCounter wrong for swap_page_out and swap_page_in
Submitted: 21 Jul 2009 17:39 Modified: 20 Aug 2009 17:46
Reporter: Leandro Morgado Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S3 (Non-critical)
Version:2.0.5.7153 OS:Any
Assigned to: Mark Leith CPU Architecture:Any

[21 Jul 2009 17:39] Leandro Morgado
Description:
Hello,

When monitoring os.mem.swap_page_out and os.mem.swap_page_in, the agent sends the values to the monitor server via xml. After putting the agent with log-level=debug, I see the following:

....
   <itemList>
     <nameSpace>os</nameSpace>
     <className>mem</className>
     <attribName>swap_page_in</attribName>
     <attribType>INTEGER</attribType>
     <isCounter>false</isCounter>
    </itemList>
.....
   <itemList>
     <nameSpace>os</nameSpace>
     <className>mem</className>
     <attribName>swap_page_out</attribName>
     <attribType>INTEGER</attribType>
     <isCounter>false</isCounter>
    </itemList>

Then I see the values being sent periodically like:

 <task>
   <taskId>1396</taskId>
   <command>collect_data</command>
   <utc>2009-07-20T18:35:37.483Z</utc>
   <data>
    <datum>
     <target>
      <namespace>os</namespace>
      <classname>mem</classname>
      <instance>ssh:{e4:d5:42:65:d7:33:fe:e4:8d:c8:36:c3:5b:3e:9e:b7}.0</instance>
      <attribute>swap_page_out</attribute>
     </target>
     <utc>2009-07-20T18:35:19.963Z</utc>
     <value>2272599</value>
    </datum>
   </data>
  </task>

As far as I have been told, the monitor server will look at the value of <isCounter> and if:

false -> will display the "absolute" value as send by the agent: <value>2272599</value>

true ->  will display a delta between the value currently sent and the previously received value.

How to repeat:
1) set the agent to log-level=debug and look at mysql-monitor-agent.log

2) I created a custom rule in the monitor with a variable for swap_page_in and out and added it to the monitored server's schedule. This may not be necessary if the agent always sends the information

Suggested fix:
To monitor swap_page_in|out what interests us is the *rate* at which swap_pages are occuring. Therefore, I believe isCounter should be true for swap_page_in and swap_page_out.
[21 Jul 2009 21:41] Enterprise Tools JIRA Robot
Mark Leith writes: 
Pushed to mysql-lb trunk (to fix the counter within the item definition within the agent) and advisors trunk (to update the items-os.xml file). 

Test graph:

  <com_mysql_merlin_server_graph_Design>
        
    <name>Swap Activity</name>
    <rangeLabel>bytes</rangeLabel>
    <series>
      <label>In</label>
      <expression>swap_in</expression>
    </series>
    <series>
      <label>Out</label>
      <expression>swap_out</expression>
    </series>
    <variables>
      <name>swap_in</name>
      <dcItem>
        <nameSpace>os</nameSpace>
        <className>mem</className>
        <attribName>swap_page_in</attribName>
      </dcItem>
      <instance>mem</instance>
    </variables>
    <variables>
      <name>swap_out</name>
      <dcItem>
        <nameSpace>os</nameSpace>
        <className>mem</className>
        <attribName>swap_page_out</attribName>
      </dcItem>
      <instance>mem</instance>
    </variables>
  </com_mysql_merlin_server_graph_Design>
[23 Jul 2009 22:59] Enterprise Tools JIRA Robot
Andy Bang writes: 
I'm pretty sure the Advisor JAR part of this fix is in 2.1.0.1080, but I'm not sure if the agent fix made it in because we built the 2.1.0.1079 agents around the same time.
[11 Aug 2009 18:49] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch installed in versions => 2.1.0.1092.
[13 Aug 2009 14:14] Enterprise Tools JIRA Robot
Diego Medina writes: 
Verified fixed on 2.1.0.1093

Both swap_page_in and swap_page_out  show isCounter as true
[20 Aug 2009 17:46] MC Brown
A note has been added to the 2.1 changelog: 

The values reported for the os.mem.swap_page_out and os.mem.swap_page_in could be identified incorrectly as delta, instead of absolute, values.