Package ai.vespa.metricsproxy.service
Class VespaService
java.lang.Object
ai.vespa.metricsproxy.service.VespaService
- All Implemented Interfaces:
Comparable<VespaService>
Represents a Vespa service
- Author:
- jobergum
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(VespaService other) voidconsumeMetrics(MetricsParser.Collector consumer) Get the Metrics registered for this service.static VespaServicestatic VespaServicecreate(String name, String id, int statePort, String monitoringName, Map<DimensionId, String> dimensions) Gets the config id of this serviceGet the instance name.final MetricsThe name used for this service in the monitoring system: monitoring-system-name.serviceNameintgetPid()The current pid of this serviceGet the service name/type.getState()Get the string representation of the state of this serviceGets the system metrics for this servicebooleanisAlive()Check if this pid/service is runningvoidsetAlive(boolean alive) voidsetPid(int pid) update the pid of this servicevoidUpdate the state of this servicevoidsetSystemMetrics(Metrics metrics) toString()
-
Field Details
-
SEPARATOR
- See Also:
-
-
Method Details
-
create
-
create
public static VespaService create(String name, String id, int statePort, String monitoringName, Map<DimensionId, String> dimensions) -
getMonitoringName
The name used for this service in the monitoring system: monitoring-system-name.serviceName -
compareTo
- Specified by:
compareToin interfaceComparable<VespaService>
-
getServiceName
Get the service name/type. E.g 'searchnode', but not 'searchnode2'- Returns:
- the service name
-
getInstanceName
Get the instance name. E.g searchnode2- Returns:
- the instance service name
-
getDimensions
-
getHealth
- Returns:
- The health of this service
-
getSystemMetrics
Gets the system metrics for this service- Returns:
- System metrics
-
consumeMetrics
Get the Metrics registered for this service. Metrics are fetched over HTTP if a metric http port has been defined, otherwise from log file -
getMetrics
-
getConfigId
Gets the config id of this service- Returns:
- the config id
-
getPid
public int getPid()The current pid of this service- Returns:
- The pid
-
setPid
public void setPid(int pid) update the pid of this service- Parameters:
pid- The pid that this service runs as
-
getState
Get the string representation of the state of this service- Returns:
- string representing the state of this service - obtained from config-sentinel
-
setState
Update the state of this service- Parameters:
state- the new state
-
isAlive
public boolean isAlive()Check if this pid/service is running- Returns:
- true if the service is alive (e.g the pid is running)
-
toString
-
setAlive
public void setAlive(boolean alive) -
setSystemMetrics
-