Class: Quark::MdkMetrics::InteractionEvent
- Inherits:
-
Object
- Object
- Quark::MdkMetrics::InteractionEvent
- 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
-
#endTimestamp ⇒ Object
Returns the value of attribute endTimestamp.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#node ⇒ Object
Returns the value of attribute node.
-
#results ⇒ Object
Returns the value of attribute results.
-
#session ⇒ Object
Returns the value of attribute session.
-
#startTimestamp ⇒ Object
Returns the value of attribute startTimestamp.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
- #__init_fields__ ⇒ Object
- #_getClass ⇒ Object
- #_getField(name) ⇒ Object
- #_setField(name, value) ⇒ Object
-
#addNode(destination, success) ⇒ Object
Add the result of communicating with a specific node.
- #getTimestamp ⇒ Object
-
#initialize ⇒ InteractionEvent
constructor
A new instance of InteractionEvent.
Methods included from DatawireQuarkCore::Static
_lazy_statics, static, unlazy_statics
Constructor Details
#initialize ⇒ InteractionEvent
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
#endTimestamp ⇒ Object
Returns the value of attribute endTimestamp.
19 20 21 |
# File 'lib/mdk_metrics.rb', line 19 def endTimestamp @endTimestamp end |
#environment ⇒ Object
Returns the value of attribute environment.
19 20 21 |
# File 'lib/mdk_metrics.rb', line 19 def environment @environment end |
#node ⇒ Object
Returns the value of attribute node.
19 20 21 |
# File 'lib/mdk_metrics.rb', line 19 def node @node end |
#results ⇒ Object
Returns the value of attribute results.
19 20 21 |
# File 'lib/mdk_metrics.rb', line 19 def results @results end |
#session ⇒ Object
Returns the value of attribute session.
19 20 21 |
# File 'lib/mdk_metrics.rb', line 19 def session @session end |
#startTimestamp ⇒ Object
Returns the value of attribute startTimestamp.
19 20 21 |
# File 'lib/mdk_metrics.rb', line 19 def startTimestamp @startTimestamp end |
#uuid ⇒ Object
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
126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/mdk_metrics.rb', line 126 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 = {} nil end |
#_getClass ⇒ Object
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 |
# 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 return nil nil end |
#_setField(name, value) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/mdk_metrics.rb', line 96 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 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 |
#getTimestamp ⇒ Object
37 38 39 40 41 42 |
# File 'lib/mdk_metrics.rb', line 37 def getTimestamp() return (self).startTimestamp nil end |