aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorgjoranv <gv@yahoo-inc.com>2016-11-10 11:02:42 +0100
committergjoranv <gv@yahoo-inc.com>2016-11-10 11:02:42 +0100
commitcdb1746351a22163b66de84fad589c20336dcdcf (patch)
tree3a123f7cf6c79a1255d3331bdcfbf6e0d0452c35 /config-model
parent6b9522fdf674342f707a8723ffb554b0dc01ac62 (diff)
Allow and test new 'metrics' element in services.xml.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/resources/schema/admin.rnc14
-rw-r--r--config-model/src/main/resources/schema/storage.rnc4
-rw-r--r--config-model/src/test/schema-test-files/services.xml10
-rwxr-xr-xconfig-model/src/test/sh/test-schema.sh2
4 files changed, 24 insertions, 6 deletions
diff --git a/config-model/src/main/resources/schema/admin.rnc b/config-model/src/main/resources/schema/admin.rnc
index 5df8ffa812b..d8782bebc8a 100644
--- a/config-model/src/main/resources/schema/admin.rnc
+++ b/config-model/src/main/resources/schema/admin.rnc
@@ -11,7 +11,7 @@ AdminV2 =
FileDistribution? &
AdminSlobroks? &
AdminYamas? &
- MetricConsumers? &
+ (LegacyMetricConsumers | Metrics)? &
ClusterControllers?
}
@@ -27,7 +27,7 @@ AdminV4 =
AdminV4Slobroks? &
AdminV4LogServers? &
AdminYamas? &
- MetricConsumers?
+ (LegacyMetricConsumers | Metrics)?
}
AdminV4Slobroks =
@@ -79,7 +79,15 @@ FileDistribution = element filedistribution {
element downloadbitrate { xsd:string { pattern = "\d+(\.\d*)?\s*[kmgKMG]?" } }?
}
-MetricConsumers = element metric-consumers {
+Metrics = element metrics {
+ element consumer {
+ attribute id { xsd:Name } &
+ element metric-set { attribute id { xsd:Name } }* &
+ element metric { attribute id { xsd:Name } }*
+ }+
+}
+
+LegacyMetricConsumers = element metric-consumers {
element consumer {
attribute name { xsd:string { pattern = "[a-zA-Z][_a-zA-Z0-9]*" } }&
element metric {
diff --git a/config-model/src/main/resources/schema/storage.rnc b/config-model/src/main/resources/schema/storage.rnc
index 538cea14301..842cbb7777b 100644
--- a/config-model/src/main/resources/schema/storage.rnc
+++ b/config-model/src/main/resources/schema/storage.rnc
@@ -109,7 +109,7 @@ FleetController20 = element fleetcontroller {
# Common definitions for v2.0 and v3.0
-Metrics = element metrics { element log { text }* }
+StorageMetrics = element metrics { element log { text }* }
Disk = element disk {
attribute index { xsd:nonNegativeInteger } &
@@ -166,7 +166,7 @@ Storage30 = element storage {
GenericConfig* &
( FleetController | FleetControllers ) &
ClusterParamsV30? &
- Metrics? &
+ StorageMetrics? &
OperationsLog20? &
Tuning20? &
Merges? &
diff --git a/config-model/src/test/schema-test-files/services.xml b/config-model/src/test/schema-test-files/services.xml
index ede0ba089a4..1b45f60bfd8 100644
--- a/config-model/src/test/schema-test-files/services.xml
+++ b/config-model/src/test/schema-test-files/services.xml
@@ -14,6 +14,16 @@
<slobrok hostalias="qrserver" />
<slobrok hostalias="rtc-1" />
</slobroks>
+ <metrics>
+ <consumer id="my-consumer">
+ <metric-set id="my-set" />
+ <metric id="my-metric"/>
+ <metric id="my-metric2"/>
+ </consumer>
+ <consumer id="my-consumer2">
+ <metric-set id="my-set2" />
+ </consumer>
+ </metrics>
</admin>
<config name="bar">
diff --git a/config-model/src/test/sh/test-schema.sh b/config-model/src/test/sh/test-schema.sh
index d9e88283568..62d75124d90 100755
--- a/config-model/src/test/sh/test-schema.sh
+++ b/config-model/src/test/sh/test-schema.sh
@@ -2,7 +2,7 @@
# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
set -e
-pushd src/main && make
+pushd src/main && make clean all
popd
jar="target/jing.jar"