Class VespaService

java.lang.Object
ai.vespa.metricsproxy.service.VespaService
All Implemented Interfaces:
Comparable<VespaService>

public class VespaService extends Object implements Comparable<VespaService>
Represents a Vespa service
Author:
jobergum
  • Field Details

  • Method Details

    • create

      public static VespaService create(String name, String id, int statePort)
    • create

      public static VespaService create(String name, String id, int statePort, String monitoringName, Map<DimensionId,String> dimensions)
    • getMonitoringName

      public ServiceId getMonitoringName()
      The name used for this service in the monitoring system: monitoring-system-name.serviceName
    • compareTo

      public int compareTo(VespaService other)
      Specified by:
      compareTo in interface Comparable<VespaService>
    • getServiceName

      public String getServiceName()
      Get the service name/type. E.g 'searchnode', but not 'searchnode2'
      Returns:
      the service name
    • getInstanceName

      public String getInstanceName()
      Get the instance name. E.g searchnode2
      Returns:
      the instance service name
    • getDimensions

      public Map<DimensionId,String> getDimensions()
    • getHealth

      public HealthMetric getHealth()
      Returns:
      The health of this service
    • getSystemMetrics

      public Metrics getSystemMetrics()
      Gets the system metrics for this service
      Returns:
      System metrics
    • consumeMetrics

      public void consumeMetrics(MetricsParser.Collector consumer)
      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

      public final Metrics getMetrics()
    • getConfigId

      public String 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

      public String getState()
      Get the string representation of the state of this service
      Returns:
      string representing the state of this service - obtained from config-sentinel
    • setState

      public void setState(String state)
      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

      public String toString()
      Overrides:
      toString in class Object
    • setAlive

      public void setAlive(boolean alive)
    • setSystemMetrics

      public void setSystemMetrics(Metrics metrics)