Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

AgentMetrics- Global

The AgentMetrics script include provides methods to process inbound MID Server metrics.

This script include updates the following tables:

  • ECC Agent Counter Metric [ecc_agent_counter_metric]
  • ECC Agent Memory Metric [ecc_agent_memory_metric]
  • ECC Agent RGR Metric [ecc_agent_rgr_metric]
  • ECC Agent Scalar Metric [ecc_agent_scalar_metric]

Use these methods in server scripts.

Parent Topic:Server API reference

AgentMetrics - AgentMetrics()

Creates an instance of AgentMetrics.

NameTypeDescription
None  

This example shows how to use AgentMetrics() to instantiate an AgentMetrics object.

var amtc = new AgentMetrics();
amtc.handleMemory('memory', 'server_name', '1098888bbb9483abcd89981ffaeff');
amtc.updateMetric('ecc_agent_memory_metric', 'm_values', 'memory', '1098888bbb9483abcd89981ffaeff');

AgentMetrics - handleCounter(String metric, String name, String midId)

Handles counter metrics from the agent by putting them into an array that can be used to update the ECC Agent Counter Metric table (ecc_agent_counter_metric).

NameTypeDescription
metricStringThe counter object from the agent
nameStringThe device name
midIdStringThe MID server sys_id
TypeDescription
void 
var amtc = new AgentMetrics();
amtc.handleCounter('count', 'server_name', '1098888bbb9483abcd89981ffaeff');

AgentMetrics - handleMemory(String metric, String name, String midId)

Updates the memory metrics for the given agent.

NameTypeDescription
metricStringThe memory object from the agent
nameStringThe device name
midIdStringThe MID server sys_id
TypeDescription
void 
var amtc = new AgentMetrics();
amtc.handleMemory('mem_obj', 'server_name', '1098888bbb9483abcd89981ffaeff');

AgentMetrics - handleRGR(String metric, String name, String midId)

Handles metric information from a remote glide record by putting it into an array.

NameTypeDescription
metricStringThe remote object from the agent
nameStringThe device name
midIdStringThe MID server sys_id
TypeDescription
void 
var amtc = new AgentMetrics();
amtc.handleRGR('remote_obj', 'server_name', '1098888bbb9483abcd89981ffaeff');

AgentMetrics - handleScalar(String metric, String name, String midId)

Handles scalar values from the agent by putting them into an array.

NameTypeDescription
metricStringThe counter object from the agent
nameStringThe device name
midIdStringThe MID server sys_id
TypeDescription
void 
var amtc = new AgentMetrics();
amtc.handleScalar('scalar', 'server_name', '1098888bbb9483abcd89981ffaeff');

AgentMetrics - updateMetric(String tableName, String values, String metric, String midID)

Updates the specified metrics table with the new metric information.

NameTypeDescription
tableNameStringThe metrics table to update
valuesStringThe object containing the values to add to the table
metricStringThe metric type to add to the table
midIDStringThe MID server sys_id
TypeDescription
void 
var amtc = new AgentMetrics();
amtc.handleMemory('memory', 'server_name', '1098888bbb9483abcd89981ffaeff');
amtc.updateMetric('ecc_agent_memory_metric', 'm_values', 'memory', '1098888bbb9483abcd89981ffaeff');