Class: Quark::MdkMetrics::InteractionEvent

Inherits:
Object
  • Object
show all
Extended by:
DatawireQuarkCore::Static
Defined in:
lib/mdk_metrics.rb

Overview

Wire protocol message for reporting interaction results to MCP.

Constant Summary

Constants included from DatawireQuarkCore::Static

DatawireQuarkCore::Static::Unassigned

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DatawireQuarkCore::Static

_lazy_statics, static, unlazy_statics

Constructor Details

#initializeInteractionEvent

Returns a new instance of InteractionEvent.



27
28
29
30
31
32
# File 'lib/mdk_metrics.rb', line 27

def initialize()
    
    super()

    nil
end

Instance Attribute Details

#endClockObject

Returns the value of attribute endClock.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def endClock
  @endClock
end

#endTimestampObject

Returns the value of attribute endTimestamp.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def endTimestamp
  @endTimestamp
end

#environmentObject

Returns the value of attribute environment.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def environment
  @environment
end

#nodeObject

Returns the value of attribute node.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def node
  @node
end

#resultsObject

Returns the value of attribute results.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def results
  @results
end

#sessionObject

Returns the value of attribute session.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def session
  @session
end

#startClockObject

Returns the value of attribute startClock.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def startClock
  @startClock
end

#startTimestampObject

Returns the value of attribute startTimestamp.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def startTimestamp
  @startTimestamp
end

#uuidObject

Returns the value of attribute uuid.



19
20
21
# File 'lib/mdk_metrics.rb', line 19

def uuid
  @uuid
end

Instance Method Details

#__init_fields__Object



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/mdk_metrics.rb', line 138

def __init_fields__()
    
    super
    self.startTimestamp = nil
    self.endTimestamp = nil
    self.environment = nil
    self.uuid = ::Quark.quark.concurrent.Context.runtime().uuid()
    self.session = nil
    self.node = nil
    self.results = {}
    self.startClock = ::DatawireQuarkCore::List.new([])
    self.endClock = ::DatawireQuarkCore::List.new([])

    nil
end

#_getClassObject



58
59
60
61
62
63
# File 'lib/mdk_metrics.rb', line 58

def _getClass()
    
    return "mdk_metrics.InteractionEvent"

    nil
end

#_getField(name) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/mdk_metrics.rb', line 65

def _getField(name)
    
    if ((name) == ("_json_type"))
        return ::Quark.mdk_metrics.InteractionEvent._json_type
    end
    if ((name) == ("startTimestamp"))
        return (self).startTimestamp
    end
    if ((name) == ("endTimestamp"))
        return (self).endTimestamp
    end
    if ((name) == ("environment"))
        return (self).environment
    end
    if ((name) == ("uuid"))
        return (self).uuid
    end
    if ((name) == ("session"))
        return (self).session
    end
    if ((name) == ("node"))
        return (self).node
    end
    if ((name) == ("results"))
        return (self).results
    end
    if ((name) == ("startClock"))
        return (self).startClock
    end
    if ((name) == ("endClock"))
        return (self).endClock
    end
    return nil

    nil
end

#_setField(name, value) ⇒ Object



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/mdk_metrics.rb', line 102

def _setField(name, value)
    
    if ((name) == ("_json_type"))
        ::Quark.mdk_metrics.InteractionEvent._json_type = ::DatawireQuarkCore.cast(value) { ::String }
    end
    if ((name) == ("startTimestamp"))
        (self).startTimestamp = ::DatawireQuarkCore.cast(value) { ::Integer }
    end
    if ((name) == ("endTimestamp"))
        (self).endTimestamp = ::DatawireQuarkCore.cast(value) { ::Integer }
    end
    if ((name) == ("environment"))
        (self).environment = ::DatawireQuarkCore.cast(value) { ::Quark.mdk_protocol.OperationalEnvironment }
    end
    if ((name) == ("uuid"))
        (self).uuid = ::DatawireQuarkCore.cast(value) { ::String }
    end
    if ((name) == ("session"))
        (self).session = ::DatawireQuarkCore.cast(value) { ::String }
    end
    if ((name) == ("node"))
        (self).node = ::DatawireQuarkCore.cast(value) { ::String }
    end
    if ((name) == ("results"))
        (self).results = ::DatawireQuarkCore.cast(value) { ::Hash }
    end
    if ((name) == ("startClock"))
        (self).startClock = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::List }
    end
    if ((name) == ("endClock"))
        (self).endClock = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::List }
    end

    nil
end

#addNode(destination, success) ⇒ Object

Add the result of communicating with a specific node.



47
48
49
50
51
52
53
54
55
56
# File 'lib/mdk_metrics.rb', line 47

def addNode(destination, success)
    
    value = 0
    if (success)
        value = 1
    end
    ((self).results)[destination.getId()] = (value)

    nil
end

#getTimestampObject



37
38
39
40
41
42
# File 'lib/mdk_metrics.rb', line 37

def getTimestamp()
    
    return (self).startTimestamp

    nil
end