zipkin_query 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/lib/zipkin_query/zipkin_core_constants.rb +19 -0
- data/lib/zipkin_query/zipkin_core_types.rb +117 -0
- data/lib/zipkin_query/zipkin_dependencies_constants.rb +11 -0
- data/lib/zipkin_query/zipkin_dependencies_types.rb +74 -0
- data/lib/zipkin_query/zipkin_query.rb +1219 -0
- data/lib/zipkin_query/zipkin_query_constants.rb +11 -0
- data/lib/zipkin_query/zipkin_query_types.rb +222 -0
- data/lib/zipkin_query.rb +10 -0
- metadata +80 -0
| @@ -0,0 +1,222 @@ | |
| 1 | 
            +
            #
         | 
| 2 | 
            +
            # Autogenerated by Thrift Compiler (0.9.1)
         | 
| 3 | 
            +
            #
         | 
| 4 | 
            +
            # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
         | 
| 5 | 
            +
            #
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            require 'thrift'
         | 
| 8 | 
            +
            require 'zipkin_query/zipkin_core_types'
         | 
| 9 | 
            +
            require 'zipkin_query/zipkin_dependencies_types'
         | 
| 10 | 
            +
             | 
| 11 | 
            +
             | 
| 12 | 
            +
            module Zipkin
         | 
| 13 | 
            +
              module Order
         | 
| 14 | 
            +
                TIMESTAMP_DESC = 0
         | 
| 15 | 
            +
                TIMESTAMP_ASC = 1
         | 
| 16 | 
            +
                DURATION_ASC = 2
         | 
| 17 | 
            +
                DURATION_DESC = 3
         | 
| 18 | 
            +
                NONE = 4
         | 
| 19 | 
            +
                VALUE_MAP = {0 => "TIMESTAMP_DESC", 1 => "TIMESTAMP_ASC", 2 => "DURATION_ASC", 3 => "DURATION_DESC", 4 => "NONE"}
         | 
| 20 | 
            +
                VALID_VALUES = Set.new([TIMESTAMP_DESC, TIMESTAMP_ASC, DURATION_ASC, DURATION_DESC, NONE]).freeze
         | 
| 21 | 
            +
              end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
              module Adjust
         | 
| 24 | 
            +
                NOTHING = 0
         | 
| 25 | 
            +
                TIME_SKEW = 1
         | 
| 26 | 
            +
                VALUE_MAP = {0 => "NOTHING", 1 => "TIME_SKEW"}
         | 
| 27 | 
            +
                VALID_VALUES = Set.new([NOTHING, TIME_SKEW]).freeze
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
              class Trace
         | 
| 31 | 
            +
                include ::Thrift::Struct, ::Thrift::Struct_Union
         | 
| 32 | 
            +
                SPANS = 1
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                FIELDS = {
         | 
| 35 | 
            +
                  SPANS => {:type => ::Thrift::Types::LIST, :name => 'spans', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Zipkin::Span}}
         | 
| 36 | 
            +
                }
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                def struct_fields; FIELDS; end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                def validate
         | 
| 41 | 
            +
                end
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                ::Thrift::Struct.generate_accessors self
         | 
| 44 | 
            +
              end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
              class QueryException < ::Thrift::Exception
         | 
| 47 | 
            +
                include ::Thrift::Struct, ::Thrift::Struct_Union
         | 
| 48 | 
            +
                def initialize(message=nil)
         | 
| 49 | 
            +
                  super()
         | 
| 50 | 
            +
                  self.msg = message
         | 
| 51 | 
            +
                end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
                def message; msg end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                MSG = 1
         | 
| 56 | 
            +
             | 
| 57 | 
            +
                FIELDS = {
         | 
| 58 | 
            +
                  MSG => {:type => ::Thrift::Types::STRING, :name => 'msg'}
         | 
| 59 | 
            +
                }
         | 
| 60 | 
            +
             | 
| 61 | 
            +
                def struct_fields; FIELDS; end
         | 
| 62 | 
            +
             | 
| 63 | 
            +
                def validate
         | 
| 64 | 
            +
                end
         | 
| 65 | 
            +
             | 
| 66 | 
            +
                ::Thrift::Struct.generate_accessors self
         | 
| 67 | 
            +
              end
         | 
| 68 | 
            +
             | 
| 69 | 
            +
              # This sums up a single Trace to make it easy for a client to get an overview of what happened.
         | 
| 70 | 
            +
              class TraceSummary
         | 
| 71 | 
            +
                include ::Thrift::Struct, ::Thrift::Struct_Union
         | 
| 72 | 
            +
                TRACE_ID = 1
         | 
| 73 | 
            +
                START_TIMESTAMP = 2
         | 
| 74 | 
            +
                END_TIMESTAMP = 3
         | 
| 75 | 
            +
                DURATION_MICRO = 4
         | 
| 76 | 
            +
                SERVICE_COUNTS = 5
         | 
| 77 | 
            +
                ENDPOINTS = 6
         | 
| 78 | 
            +
             | 
| 79 | 
            +
                FIELDS = {
         | 
| 80 | 
            +
                  TRACE_ID => {:type => ::Thrift::Types::I64, :name => 'trace_id'},
         | 
| 81 | 
            +
                  START_TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'start_timestamp'},
         | 
| 82 | 
            +
                  END_TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'end_timestamp'},
         | 
| 83 | 
            +
                  DURATION_MICRO => {:type => ::Thrift::Types::I32, :name => 'duration_micro'},
         | 
| 84 | 
            +
                  SERVICE_COUNTS => {:type => ::Thrift::Types::MAP, :name => 'service_counts', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I32}},
         | 
| 85 | 
            +
                  ENDPOINTS => {:type => ::Thrift::Types::LIST, :name => 'endpoints', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Zipkin::Endpoint}}
         | 
| 86 | 
            +
                }
         | 
| 87 | 
            +
             | 
| 88 | 
            +
                def struct_fields; FIELDS; end
         | 
| 89 | 
            +
             | 
| 90 | 
            +
                def validate
         | 
| 91 | 
            +
                end
         | 
| 92 | 
            +
             | 
| 93 | 
            +
                ::Thrift::Struct.generate_accessors self
         | 
| 94 | 
            +
              end
         | 
| 95 | 
            +
             | 
| 96 | 
            +
              # A modified version of the Annotation struct that brings in more information
         | 
| 97 | 
            +
              class TimelineAnnotation
         | 
| 98 | 
            +
                include ::Thrift::Struct, ::Thrift::Struct_Union
         | 
| 99 | 
            +
                TIMESTAMP = 1
         | 
| 100 | 
            +
                VALUE = 2
         | 
| 101 | 
            +
                HOST = 3
         | 
| 102 | 
            +
                SPAN_ID = 4
         | 
| 103 | 
            +
                PARENT_ID = 5
         | 
| 104 | 
            +
                SERVICE_NAME = 6
         | 
| 105 | 
            +
                SPAN_NAME = 7
         | 
| 106 | 
            +
             | 
| 107 | 
            +
                FIELDS = {
         | 
| 108 | 
            +
                  TIMESTAMP => {:type => ::Thrift::Types::I64, :name => 'timestamp'},
         | 
| 109 | 
            +
                  VALUE => {:type => ::Thrift::Types::STRING, :name => 'value'},
         | 
| 110 | 
            +
                  HOST => {:type => ::Thrift::Types::STRUCT, :name => 'host', :class => ::Zipkin::Endpoint},
         | 
| 111 | 
            +
                  SPAN_ID => {:type => ::Thrift::Types::I64, :name => 'span_id'},
         | 
| 112 | 
            +
                  PARENT_ID => {:type => ::Thrift::Types::I64, :name => 'parent_id', :optional => true},
         | 
| 113 | 
            +
                  SERVICE_NAME => {:type => ::Thrift::Types::STRING, :name => 'service_name'},
         | 
| 114 | 
            +
                  SPAN_NAME => {:type => ::Thrift::Types::STRING, :name => 'span_name'}
         | 
| 115 | 
            +
                }
         | 
| 116 | 
            +
             | 
| 117 | 
            +
                def struct_fields; FIELDS; end
         | 
| 118 | 
            +
             | 
| 119 | 
            +
                def validate
         | 
| 120 | 
            +
                end
         | 
| 121 | 
            +
             | 
| 122 | 
            +
                ::Thrift::Struct.generate_accessors self
         | 
| 123 | 
            +
              end
         | 
| 124 | 
            +
             | 
| 125 | 
            +
              # This sums up a single Trace to make it easy for a client to get an overview of what happened.
         | 
| 126 | 
            +
              class TraceTimeline
         | 
| 127 | 
            +
                include ::Thrift::Struct, ::Thrift::Struct_Union
         | 
| 128 | 
            +
                TRACE_ID = 1
         | 
| 129 | 
            +
                ROOT_MOST_SPAN_ID = 2
         | 
| 130 | 
            +
                ANNOTATIONS = 6
         | 
| 131 | 
            +
                BINARY_ANNOTATIONS = 7
         | 
| 132 | 
            +
             | 
| 133 | 
            +
                FIELDS = {
         | 
| 134 | 
            +
                  TRACE_ID => {:type => ::Thrift::Types::I64, :name => 'trace_id'},
         | 
| 135 | 
            +
                  ROOT_MOST_SPAN_ID => {:type => ::Thrift::Types::I64, :name => 'root_most_span_id'},
         | 
| 136 | 
            +
                  ANNOTATIONS => {:type => ::Thrift::Types::LIST, :name => 'annotations', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Zipkin::TimelineAnnotation}},
         | 
| 137 | 
            +
                  BINARY_ANNOTATIONS => {:type => ::Thrift::Types::LIST, :name => 'binary_annotations', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Zipkin::BinaryAnnotation}}
         | 
| 138 | 
            +
                }
         | 
| 139 | 
            +
             | 
| 140 | 
            +
                def struct_fields; FIELDS; end
         | 
| 141 | 
            +
             | 
| 142 | 
            +
                def validate
         | 
| 143 | 
            +
                end
         | 
| 144 | 
            +
             | 
| 145 | 
            +
                ::Thrift::Struct.generate_accessors self
         | 
| 146 | 
            +
              end
         | 
| 147 | 
            +
             | 
| 148 | 
            +
              # Returns a combination of trace, summary and timeline.
         | 
| 149 | 
            +
              class TraceCombo
         | 
| 150 | 
            +
                include ::Thrift::Struct, ::Thrift::Struct_Union
         | 
| 151 | 
            +
                TRACE = 1
         | 
| 152 | 
            +
                SUMMARY = 2
         | 
| 153 | 
            +
                TIMELINE = 3
         | 
| 154 | 
            +
                SPAN_DEPTHS = 4
         | 
| 155 | 
            +
             | 
| 156 | 
            +
                FIELDS = {
         | 
| 157 | 
            +
                  TRACE => {:type => ::Thrift::Types::STRUCT, :name => 'trace', :class => ::Zipkin::Trace},
         | 
| 158 | 
            +
                  SUMMARY => {:type => ::Thrift::Types::STRUCT, :name => 'summary', :class => ::Zipkin::TraceSummary, :optional => true},
         | 
| 159 | 
            +
                  TIMELINE => {:type => ::Thrift::Types::STRUCT, :name => 'timeline', :class => ::Zipkin::TraceTimeline, :optional => true},
         | 
| 160 | 
            +
                  SPAN_DEPTHS => {:type => ::Thrift::Types::MAP, :name => 'span_depths', :key => {:type => ::Thrift::Types::I64}, :value => {:type => ::Thrift::Types::I32}, :optional => true}
         | 
| 161 | 
            +
                }
         | 
| 162 | 
            +
             | 
| 163 | 
            +
                def struct_fields; FIELDS; end
         | 
| 164 | 
            +
             | 
| 165 | 
            +
                def validate
         | 
| 166 | 
            +
                end
         | 
| 167 | 
            +
             | 
| 168 | 
            +
                ::Thrift::Struct.generate_accessors self
         | 
| 169 | 
            +
              end
         | 
| 170 | 
            +
             | 
| 171 | 
            +
              class QueryRequest
         | 
| 172 | 
            +
                include ::Thrift::Struct, ::Thrift::Struct_Union
         | 
| 173 | 
            +
                SERVICE_NAME = 1
         | 
| 174 | 
            +
                SPAN_NAME = 2
         | 
| 175 | 
            +
                ANNOTATIONS = 3
         | 
| 176 | 
            +
                BINARY_ANNOTATIONS = 4
         | 
| 177 | 
            +
                END_TS = 5
         | 
| 178 | 
            +
                LIMIT = 6
         | 
| 179 | 
            +
                ORDER = 7
         | 
| 180 | 
            +
             | 
| 181 | 
            +
                FIELDS = {
         | 
| 182 | 
            +
                  SERVICE_NAME => {:type => ::Thrift::Types::STRING, :name => 'service_name'},
         | 
| 183 | 
            +
                  SPAN_NAME => {:type => ::Thrift::Types::STRING, :name => 'span_name', :optional => true},
         | 
| 184 | 
            +
                  ANNOTATIONS => {:type => ::Thrift::Types::LIST, :name => 'annotations', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
         | 
| 185 | 
            +
                  BINARY_ANNOTATIONS => {:type => ::Thrift::Types::LIST, :name => 'binary_annotations', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Zipkin::BinaryAnnotation}, :optional => true},
         | 
| 186 | 
            +
                  END_TS => {:type => ::Thrift::Types::I64, :name => 'end_ts'},
         | 
| 187 | 
            +
                  LIMIT => {:type => ::Thrift::Types::I32, :name => 'limit'},
         | 
| 188 | 
            +
                  ORDER => {:type => ::Thrift::Types::I32, :name => 'order', :enum_class => ::Zipkin::Order}
         | 
| 189 | 
            +
                }
         | 
| 190 | 
            +
             | 
| 191 | 
            +
                def struct_fields; FIELDS; end
         | 
| 192 | 
            +
             | 
| 193 | 
            +
                def validate
         | 
| 194 | 
            +
                  unless @order.nil? || ::Zipkin::Order::VALID_VALUES.include?(@order)
         | 
| 195 | 
            +
                    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field order!')
         | 
| 196 | 
            +
                  end
         | 
| 197 | 
            +
                end
         | 
| 198 | 
            +
             | 
| 199 | 
            +
                ::Thrift::Struct.generate_accessors self
         | 
| 200 | 
            +
              end
         | 
| 201 | 
            +
             | 
| 202 | 
            +
              class QueryResponse
         | 
| 203 | 
            +
                include ::Thrift::Struct, ::Thrift::Struct_Union
         | 
| 204 | 
            +
                TRACE_IDS = 1
         | 
| 205 | 
            +
                START_TS = 2
         | 
| 206 | 
            +
                END_TS = 3
         | 
| 207 | 
            +
             | 
| 208 | 
            +
                FIELDS = {
         | 
| 209 | 
            +
                  TRACE_IDS => {:type => ::Thrift::Types::LIST, :name => 'trace_ids', :element => {:type => ::Thrift::Types::I64}},
         | 
| 210 | 
            +
                  START_TS => {:type => ::Thrift::Types::I64, :name => 'start_ts'},
         | 
| 211 | 
            +
                  END_TS => {:type => ::Thrift::Types::I64, :name => 'end_ts'}
         | 
| 212 | 
            +
                }
         | 
| 213 | 
            +
             | 
| 214 | 
            +
                def struct_fields; FIELDS; end
         | 
| 215 | 
            +
             | 
| 216 | 
            +
                def validate
         | 
| 217 | 
            +
                end
         | 
| 218 | 
            +
             | 
| 219 | 
            +
                ::Thrift::Struct.generate_accessors self
         | 
| 220 | 
            +
              end
         | 
| 221 | 
            +
             | 
| 222 | 
            +
            end
         | 
    
        data/lib/zipkin_query.rb
    ADDED
    
    
    
        metadata
    ADDED
    
    | @@ -0,0 +1,80 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: zipkin_query
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.0.2
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Zerd Liu
         | 
| 8 | 
            +
            - Zhuofu Xu
         | 
| 9 | 
            +
            - John Zhao
         | 
| 10 | 
            +
            autorequire: 
         | 
| 11 | 
            +
            bindir: bin
         | 
| 12 | 
            +
            cert_chain: []
         | 
| 13 | 
            +
            date: 2014-07-25 00:00:00.000000000 Z
         | 
| 14 | 
            +
            dependencies:
         | 
| 15 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 16 | 
            +
              name: thrift
         | 
| 17 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 18 | 
            +
                requirements:
         | 
| 19 | 
            +
                - - ~>
         | 
| 20 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 21 | 
            +
                    version: 0.9.0
         | 
| 22 | 
            +
              type: :runtime
         | 
| 23 | 
            +
              prerelease: false
         | 
| 24 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 25 | 
            +
                requirements:
         | 
| 26 | 
            +
                - - ~>
         | 
| 27 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 28 | 
            +
                    version: 0.9.0
         | 
| 29 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 30 | 
            +
              name: thrift_client
         | 
| 31 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 32 | 
            +
                requirements:
         | 
| 33 | 
            +
                - - ~>
         | 
| 34 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 35 | 
            +
                    version: 0.9.2
         | 
| 36 | 
            +
              type: :runtime
         | 
| 37 | 
            +
              prerelease: false
         | 
| 38 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 39 | 
            +
                requirements:
         | 
| 40 | 
            +
                - - ~>
         | 
| 41 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 42 | 
            +
                    version: 0.9.2
         | 
| 43 | 
            +
            description: 
         | 
| 44 | 
            +
            email: 
         | 
| 45 | 
            +
            executables: []
         | 
| 46 | 
            +
            extensions: []
         | 
| 47 | 
            +
            extra_rdoc_files: []
         | 
| 48 | 
            +
            files:
         | 
| 49 | 
            +
            - lib/zipkin_query.rb
         | 
| 50 | 
            +
            - lib/zipkin_query/zipkin_core_constants.rb
         | 
| 51 | 
            +
            - lib/zipkin_query/zipkin_core_types.rb
         | 
| 52 | 
            +
            - lib/zipkin_query/zipkin_dependencies_constants.rb
         | 
| 53 | 
            +
            - lib/zipkin_query/zipkin_dependencies_types.rb
         | 
| 54 | 
            +
            - lib/zipkin_query/zipkin_query.rb
         | 
| 55 | 
            +
            - lib/zipkin_query/zipkin_query_constants.rb
         | 
| 56 | 
            +
            - lib/zipkin_query/zipkin_query_types.rb
         | 
| 57 | 
            +
            homepage: 
         | 
| 58 | 
            +
            licenses: []
         | 
| 59 | 
            +
            metadata: {}
         | 
| 60 | 
            +
            post_install_message: 
         | 
| 61 | 
            +
            rdoc_options: []
         | 
| 62 | 
            +
            require_paths:
         | 
| 63 | 
            +
            - lib
         | 
| 64 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
              requirements:
         | 
| 66 | 
            +
              - - ! '>='
         | 
| 67 | 
            +
                - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                  version: '0'
         | 
| 69 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 70 | 
            +
              requirements:
         | 
| 71 | 
            +
              - - ! '>='
         | 
| 72 | 
            +
                - !ruby/object:Gem::Version
         | 
| 73 | 
            +
                  version: '0'
         | 
| 74 | 
            +
            requirements: []
         | 
| 75 | 
            +
            rubyforge_project: 
         | 
| 76 | 
            +
            rubygems_version: 2.2.2
         | 
| 77 | 
            +
            signing_key: 
         | 
| 78 | 
            +
            specification_version: 4
         | 
| 79 | 
            +
            summary: A Zipkin query client.
         | 
| 80 | 
            +
            test_files: []
         |