Update schema with latest schema generator that has couple fixes
This commit is contained in:
Родитель
de92ca6972
Коммит
2c8216a43d
|
@ -1,8 +1,8 @@
|
|||
$generatorPath = "C:\src\mseng\AppInsights-Common"
|
||||
$publicSchemaLocation = "https://raw.githubusercontent.com/Microsoft/ApplicationInsights-Home/master/EndpointSpecs/Schemas/Bond"
|
||||
$schemasPath = "C:\src\github\ApplicationInsights\ruby\Schema\PublicSchema"
|
||||
|
||||
$currentDir = $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
|
||||
$schemasPath = "$currentDir\PublicSchema"
|
||||
|
||||
#fix path
|
||||
$generatorPath = "$generatorPath\..\bin\Debug\BondSchemaGenerator\BondSchemaGenerator"
|
||||
|
||||
|
@ -10,8 +10,7 @@ $generatorPath = "$generatorPath\..\bin\Debug\BondSchemaGenerator\BondSchemaGene
|
|||
#####################################################################
|
||||
## PUBLIC SCHEMA
|
||||
#####################################################################
|
||||
|
||||
mkdir -Force $currentDir\PublicSchema
|
||||
mkdir -Force $schemasPath
|
||||
|
||||
function RegExReplace([string]$fileName, [string]$regex, [string]$replacement="")
|
||||
{
|
||||
|
|
|
@ -4,9 +4,5 @@ module ApplicationInsights::Channel::Contracts
|
|||
class Domain
|
||||
include JsonSerializable
|
||||
|
||||
attr_accessor
|
||||
|
||||
attribute_mapping(
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ module ApplicationInsights
|
|||
module ClassMethods
|
||||
attr_reader :json_mappings
|
||||
|
||||
def attribute_mapping(mappings)
|
||||
def attribute_mapping(mappings = {})
|
||||
@json_mappings = mappings
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,17 +4,15 @@ module ApplicationInsights::Channel::Contracts
|
|||
class PageViewPerfData
|
||||
include JsonSerializable
|
||||
|
||||
attr_accessor :ver, :ver, :url, :perf_total, :name, :name, :duration, :network_connect,
|
||||
attr_accessor :ver, :url, :perf_total, :name, :duration, :network_connect,
|
||||
:sent_request, :received_response, :id, :dom_processing, :referrer_uri,
|
||||
:properties, :properties, :measurements:measurements
|
||||
:properties, :measurements
|
||||
|
||||
attribute_mapping(
|
||||
ver: 'ver',
|
||||
ver: 'ver',
|
||||
url: 'url',
|
||||
perf_total: 'perfTotal',
|
||||
name: 'name',
|
||||
name: 'name',
|
||||
duration: 'duration',
|
||||
network_connect: 'networkConnect',
|
||||
sent_request: 'sentRequest',
|
||||
|
@ -23,8 +21,6 @@ module ApplicationInsights::Channel::Contracts
|
|||
dom_processing: 'domProcessing',
|
||||
referrer_uri: 'referrerUri',
|
||||
properties: 'properties',
|
||||
properties: 'properties',
|
||||
measurements: 'measurements'
|
||||
measurements: 'measurements'
|
||||
)
|
||||
|
||||
|
@ -32,22 +28,10 @@ module ApplicationInsights::Channel::Contracts
|
|||
@ver ||= 2
|
||||
end
|
||||
|
||||
def ver
|
||||
@ver ||= 2
|
||||
end
|
||||
|
||||
def properties
|
||||
@properties ||= {}
|
||||
end
|
||||
|
||||
def properties
|
||||
@properties ||= {}
|
||||
end
|
||||
|
||||
def measurements
|
||||
@measurements ||= {}
|
||||
end
|
||||
|
||||
def measurements
|
||||
@measurements ||= {}
|
||||
end
|
||||
|
|
|
@ -21,18 +21,6 @@ class TestPageViewPerfData < Test::Unit::TestCase
|
|||
assert_equal expected, actual
|
||||
end
|
||||
|
||||
def test_ver_works_as_expected
|
||||
expected = 63
|
||||
item = Contracts::PageViewPerfData.new
|
||||
item.ver = expected
|
||||
actual = item.ver
|
||||
assert_equal expected, actual
|
||||
expected = 21
|
||||
item.ver = expected
|
||||
actual = item.ver
|
||||
assert_equal expected, actual
|
||||
end
|
||||
|
||||
def test_url_works_as_expected
|
||||
expected = 'nxcKNxAq'
|
||||
item = Contracts::PageViewPerfData.new
|
||||
|
@ -69,18 +57,6 @@ class TestPageViewPerfData < Test::Unit::TestCase
|
|||
assert_equal expected, actual
|
||||
end
|
||||
|
||||
def test_name_works_as_expected
|
||||
expected = 'FPkYRwor'
|
||||
item = Contracts::PageViewPerfData.new
|
||||
item.name = expected
|
||||
actual = item.name
|
||||
assert_equal expected, actual
|
||||
expected = 'mwxmSpxU'
|
||||
item.name = expected
|
||||
actual = item.name
|
||||
assert_equal expected, actual
|
||||
end
|
||||
|
||||
def test_duration_works_as_expected
|
||||
expected = 'WaazkJXv'
|
||||
item = Contracts::PageViewPerfData.new
|
||||
|
@ -171,18 +147,6 @@ class TestPageViewPerfData < Test::Unit::TestCase
|
|||
assert_not_nil actual
|
||||
end
|
||||
|
||||
def test_properties_works_as_expected
|
||||
item = Contracts::PageViewPerfData.new
|
||||
actual = item.properties
|
||||
assert_not_nil actual
|
||||
end
|
||||
|
||||
def test_measurements_works_as_expected
|
||||
item = Contracts::PageViewPerfData.new
|
||||
actual = item.measurements
|
||||
assert_not_nil actual
|
||||
end
|
||||
|
||||
def test_measurements_works_as_expected
|
||||
item = Contracts::PageViewPerfData.new
|
||||
actual = item.measurements
|
||||
|
@ -212,11 +176,9 @@ class TestPageViewPerfData < Test::Unit::TestCase
|
|||
item.measurements[key] = value
|
||||
end
|
||||
item.ver = 63
|
||||
item.ver = 63
|
||||
item.url = 'nxcKNxAq'
|
||||
item.perf_total = 'jItXKRPj'
|
||||
item.name = 'FPkYRwor'
|
||||
item.name = 'FPkYRwor'
|
||||
item.duration = 'WaazkJXv'
|
||||
item.network_connect = 'zkjWxHlP'
|
||||
item.sent_request = 'CeetTzfH'
|
||||
|
@ -227,12 +189,6 @@ class TestPageViewPerfData < Test::Unit::TestCase
|
|||
{ 'fEUK' => 'CmlXfTfm' }.each do |key, value|
|
||||
item.properties[key] = value
|
||||
end
|
||||
{ 'fEUK' => 'CmlXfTfm' }.each do |key, value|
|
||||
item.properties[key] = value
|
||||
end
|
||||
{ 'WxIM' => 4.509 }.each do |key, value|
|
||||
item.measurements[key] = value
|
||||
end
|
||||
{ 'WxIM' => 4.509 }.each do |key, value|
|
||||
item.measurements[key] = value
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче