Class SnapshotLifecycleStats

java.lang.Object
org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class SnapshotLifecycleStats extends Object implements Writeable, org.elasticsearch.xcontent.ToXContentObject
SnapshotLifecycleStats contains metrics and stats about snapshot lifecycle policy execution - how many snapshots were taken, deleted, how many failures, etc. It contains both global stats (snapshots taken, retention runs), and per-policy stats.
  • Field Details

    • RETENTION_RUNS

      public static final org.elasticsearch.xcontent.ParseField RETENTION_RUNS
    • RETENTION_FAILED

      public static final org.elasticsearch.xcontent.ParseField RETENTION_FAILED
    • RETENTION_TIMED_OUT

      public static final org.elasticsearch.xcontent.ParseField RETENTION_TIMED_OUT
    • RETENTION_TIME

      public static final org.elasticsearch.xcontent.ParseField RETENTION_TIME
    • RETENTION_TIME_MILLIS

      public static final org.elasticsearch.xcontent.ParseField RETENTION_TIME_MILLIS
    • POLICY_STATS

      public static final org.elasticsearch.xcontent.ParseField POLICY_STATS
    • TOTAL_TAKEN

      public static final org.elasticsearch.xcontent.ParseField TOTAL_TAKEN
    • TOTAL_FAILED

      public static final org.elasticsearch.xcontent.ParseField TOTAL_FAILED
    • TOTAL_DELETIONS

      public static final org.elasticsearch.xcontent.ParseField TOTAL_DELETIONS
    • TOTAL_DELETION_FAILURES

      public static final org.elasticsearch.xcontent.ParseField TOTAL_DELETION_FAILURES
  • Constructor Details

  • Method Details

    • parse

      public static SnapshotLifecycleStats parse(org.elasticsearch.xcontent.XContentParser parser)
    • merge

    • removePolicy

      public SnapshotLifecycleStats removePolicy(String policyId)
    • getMetrics

      Returns:
      a map of per-policy stats for each SLM policy
    • withRetentionRunIncremented

      public SnapshotLifecycleStats withRetentionRunIncremented()
      Return new stats with number of times SLM retention has been run incremented
    • withRetentionFailedIncremented

      public SnapshotLifecycleStats withRetentionFailedIncremented()
      Return new stats with number of times SLM retention has failed incremented
    • withRetentionTimedOutIncremented

      public SnapshotLifecycleStats withRetentionTimedOutIncremented()
      Return new stats the number of times that SLM retention timed out due to the max delete time window being exceeded incremented
    • withDeletionTimeUpdated

      public SnapshotLifecycleStats withDeletionTimeUpdated(org.elasticsearch.core.TimeValue elapsedTime)
      Return new stats with the amount of time taken for deleting snapshots during SLM retention updated
    • withTakenIncremented

      public SnapshotLifecycleStats withTakenIncremented(String slmPolicy)
      Return new stats with the per-policy snapshot taken count for the given policy id incremented
    • withFailedIncremented

      public SnapshotLifecycleStats withFailedIncremented(String slmPolicy)
      Return new stats with the per-policy snapshot failure count for the given policy id incremented
    • withDeletedIncremented

      public SnapshotLifecycleStats withDeletedIncremented(String slmPolicy)
      Return new stats with the per-policy snapshot deleted count for the given policy id incremented
    • withDeleteFailureIncremented

      public SnapshotLifecycleStats withDeleteFailureIncremented(String slmPolicy)
      Return new stats with the per-policy snapshot deletion failure count for the given policy id incremented
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object