Sha256: 77125fe4f9fe2fbeb9c5c53ec11754522d7e12e5105d7a659a4af762fa668cfb

Contents?: true

Size: 1.78 KB

Versions: 1

Compression:

Stored size: 1.78 KB

Contents

# encoding: utf-8
require_relative "../../spec_helper"
require "sinatra"
require "logstash/api/modules/node_stats"
require "logstash/json"

describe LogStash::Api::Modules::NodeStats do
  include_context "api setup"

  extend ResourceDSLMethods

  # DSL describing response structure
  root_structure = {
    "jvm"=>{
      "threads"=>{
        "count"=>Numeric,
        "peak_count"=>Numeric
      },
      "mem" => {
        "heap_used_in_bytes" => Numeric,
        "heap_used_percent" => Numeric,
        "heap_committed_in_bytes" => Numeric,
        "heap_max_in_bytes" => Numeric,
        "non_heap_used_in_bytes" => Numeric,
        "non_heap_committed_in_bytes" => Numeric,
        "pools" => {
          "survivor" => {
            "peak_used_in_bytes" => Numeric,
            "used_in_bytes" => Numeric,
            "peak_max_in_bytes" => Numeric,
            "max_in_bytes" => Numeric
          },
          "old" => {
            "peak_used_in_bytes" => Numeric,
            "used_in_bytes" => Numeric,
            "peak_max_in_bytes" => Numeric,
            "max_in_bytes" => Numeric
          },
          "young" => {
            "peak_used_in_bytes" => Numeric,
            "used_in_bytes" => Numeric,
            "peak_max_in_bytes" => Numeric,
            "max_in_bytes" => Numeric
          }
        }
      }
    },
    "process"=>{
      "peak_open_file_descriptors"=>Numeric,
      "max_file_descriptors"=>Numeric,
      "open_file_descriptors"=>Numeric,
      "mem"=>{
        "total_virtual_in_bytes"=>Numeric
      },
      "cpu"=>{
        "total_in_millis"=>Numeric,
        "percent"=>Numeric
      }
    },
   "pipeline" => {
     "events" => {
        "in" => Numeric,
        "filtered" => Numeric,
        "out" => Numeric
     } 
    } 
  }
  
  test_api_and_resources(root_structure)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
logstash-core-5.0.0.alpha5.snapshot1-java spec/api/lib/api/node_stats_spec.rb