Class: ApplicationInsights::Channel::Contracts::DataPoint

Inherits:
JsonSerializable show all
Defined in:
lib/application_insights/channel/contracts/data_point.rb

Overview

Data contract class for type DataPoint.

Instance Method Summary collapse

Methods inherited from JsonSerializable

#to_h, #to_json

Constructor Details

#initialize(options = {}) ⇒ DataPoint

Initializes a new instance of the DataPoint class.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/application_insights/channel/contracts/data_point.rb', line 10

def initialize(options={})
  defaults = {
    'name' => nil,
    'kind' => DataPointType::MEASUREMENT,
    'value' => nil,
    'count' => nil,
    'min' => nil,
    'max' => nil,
    'stdDev' => nil
  }
  values = {
    'name' => nil,
    'kind' => DataPointType::MEASUREMENT,
    'value' => nil
  }
  super defaults, values, options
end

Instance Method Details

#countObject

Gets the count property.



65
66
67
68
69
# File 'lib/application_insights/channel/contracts/data_point.rb', line 65

def count
  @values.fetch('count') { 
    @values['count'] = nil
  }
end

#count=(value) ⇒ Object

Sets the count property.



72
73
74
75
76
77
78
# File 'lib/application_insights/channel/contracts/data_point.rb', line 72

def count=(value)
  if value == @defaults['count']
    @values.delete 'count' if @values.key? 'count'
  else
    @values['count'] = value
  end
end

#kindObject

Gets the kind property.



39
40
41
42
43
# File 'lib/application_insights/channel/contracts/data_point.rb', line 39

def kind
  @values.fetch('kind') { 
    @values['kind'] = DataPointType::MEASUREMENT
  }
end

#kind=(value) ⇒ Object

Sets the kind property.



46
47
48
49
50
51
52
# File 'lib/application_insights/channel/contracts/data_point.rb', line 46

def kind=(value)
  if value == @defaults['kind']
    @values.delete 'kind' if @values.key? 'kind'
  else
    @values['kind'] = value
  end
end

#maxObject

Gets the max property.



97
98
99
100
101
# File 'lib/application_insights/channel/contracts/data_point.rb', line 97

def max
  @values.fetch('max') { 
    @values['max'] = nil
  }
end

#max=(value) ⇒ Object

Sets the max property.



104
105
106
107
108
109
110
# File 'lib/application_insights/channel/contracts/data_point.rb', line 104

def max=(value)
  if value == @defaults['max']
    @values.delete 'max' if @values.key? 'max'
  else
    @values['max'] = value
  end
end

#minObject

Gets the min property.



81
82
83
84
85
# File 'lib/application_insights/channel/contracts/data_point.rb', line 81

def min
  @values.fetch('min') { 
    @values['min'] = nil
  }
end

#min=(value) ⇒ Object

Sets the min property.



88
89
90
91
92
93
94
# File 'lib/application_insights/channel/contracts/data_point.rb', line 88

def min=(value)
  if value == @defaults['min']
    @values.delete 'min' if @values.key? 'min'
  else
    @values['min'] = value
  end
end

#nameObject

Gets the name property.



29
30
31
# File 'lib/application_insights/channel/contracts/data_point.rb', line 29

def name
  @values['name']
end

#name=(value) ⇒ Object

Sets the name property.



34
35
36
# File 'lib/application_insights/channel/contracts/data_point.rb', line 34

def name=(value)
  @values['name'] = value
end

#std_devObject

Gets the std_dev property.



113
114
115
116
117
# File 'lib/application_insights/channel/contracts/data_point.rb', line 113

def std_dev
  @values.fetch('stdDev') { 
    @values['stdDev'] = nil
  }
end

#std_dev=(value) ⇒ Object

Sets the std_dev property.



120
121
122
123
124
125
126
# File 'lib/application_insights/channel/contracts/data_point.rb', line 120

def std_dev=(value)
  if value == @defaults['stdDev']
    @values.delete 'stdDev' if @values.key? 'stdDev'
  else
    @values['stdDev'] = value
  end
end

#valueObject

Gets the value property.



55
56
57
# File 'lib/application_insights/channel/contracts/data_point.rb', line 55

def value
  @values['value']
end

#value=(value) ⇒ Object

Sets the value property.



60
61
62
# File 'lib/application_insights/channel/contracts/data_point.rb', line 60

def value=(value)
  @values['value'] = value
end