You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ko...@apache.org on 2018/03/05 06:36:53 UTC
[2/8] lucene-solr:master: SOLR-11795: Add Solr metrics exporter for
Prometheus
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema
new file mode 100644
index 0000000..caa3317
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema
@@ -0,0 +1,412 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+
+ This example schema is the recommended starting point for users.
+ It should be kept correct and concise, usable out-of-the-box.
+
+
+ For more information, on how to customize this file, please see
+ http://lucene.apache.org/solr/guide/documents-fields-and-schema-design.html
+
+ PERFORMANCE NOTE: this schema includes many optional features and should not
+ be used for benchmarking. To improve performance one could
+ - set stored="false" for all fields possible (esp large fields) when you
+ only need to search on the field but don't need to return the original
+ value.
+ - set indexed="false" if you don't need to search on the field, but only
+ return the field as a result of searching on other indexed fields.
+ - remove all unneeded copyField statements
+ - for best index size and searching performance, set "index" to false
+ for all general text fields, use copyField to copy them to the
+ catchall "text" field, and use that for searching.
+-->
+
+<schema name="collection1-config" version="1.6">
+ <!-- attribute "name" is the name of this schema and is only used for display purposes.
+ version="x.y" is Solr's version number for the schema syntax and
+ semantics. It should not normally be changed by applications.
+
+ 1.0: multiValued attribute did not exist, all fields are multiValued
+ by nature
+ 1.1: multiValued attribute introduced, false by default
+ 1.2: omitTermFreqAndPositions attribute introduced, true by default
+ except for text fields.
+ 1.3: removed optional field compress feature
+ 1.4: autoGeneratePhraseQueries attribute introduced to drive QueryParser
+ behavior when a single string produces multiple tokens. Defaults
+ to off for version >= 1.4
+ 1.5: omitNorms defaults to true for primitive field types
+ (int, float, boolean, string...)
+ 1.6: useDocValuesAsStored defaults to true.
+ -->
+
+ <!-- Valid attributes for fields:
+ name: mandatory - the name for the field
+ type: mandatory - the name of a field type from the
+ fieldTypes section
+ indexed: true if this field should be indexed (searchable or sortable)
+ stored: true if this field should be retrievable
+ docValues: true if this field should have doc values. Doc Values is
+ recommended (required, if you are using *Point fields) for faceting,
+ grouping, sorting and function queries. Doc Values will make the index
+ faster to load, more NRT-friendly and more memory-efficient.
+ They are currently only supported by StrField, UUIDField, all
+ *PointFields, and depending on the field type, they might require
+ the field to be single-valued, be required or have a default value
+ (check the documentation of the field type you're interested in for
+ more information)
+ multiValued: true if this field may contain multiple values per document
+ omitNorms: (expert) set to true to omit the norms associated with
+ this field (this disables length normalization and index-time
+ boosting for the field, and saves some memory). Only full-text
+ fields or fields that need an index-time boost need norms.
+ Norms are omitted for primitive (non-analyzed) types by default.
+ termVectors: [false] set to true to store the term vector for a
+ given field.
+ When using MoreLikeThis, fields used for similarity should be
+ stored for best performance.
+ termPositions: Store position information with the term vector.
+ This will increase storage costs.
+ termOffsets: Store offset information with the term vector. This
+ will increase storage costs.
+ required: The field is required. It will throw an error if the
+ value does not exist
+ default: a value that should be used if no value is specified
+ when adding a document.
+ -->
+
+ <!-- field names should consist of alphanumeric or underscore characters only and
+ not start with a digit. This is not currently strictly enforced,
+ but other field names will not have first class support from all components
+ and back compatibility is not guaranteed. Names with both leading and
+ trailing underscores (e.g. _version_) are reserved.
+ -->
+
+ <!-- In this _default configset, only four fields are pre-declared:
+ id, _version_, and _text_ and _root_. All other fields will be type guessed and added via the
+ "add-unknown-fields-to-the-schema" update request processor chain declared in solrconfig.xml.
+
+ Note that many dynamic fields are also defined - you can use them to specify a
+ field's type via field naming conventions - see below.
+
+ WARNING: The _text_ catch-all field will significantly increase your index size.
+ If you don't need it, consider removing it and the corresponding copyField directive.
+ -->
+
+ <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
+ <!-- docValues are enabled by default for long type so we don't need to index the version field -->
+ <field name="_version_" type="plong" indexed="false" stored="false"/>
+ <field name="_root_" type="string" indexed="true" stored="false" docValues="false" />
+ <field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true"/>
+
+ <!-- This can be enabled, in case the client does not know what fields may be searched. It isn't enabled by default
+ because it's very expensive to index everything twice. -->
+ <!-- <copyField source="*" dest="_text_"/> -->
+
+ <!-- Dynamic field definitions allow using convention over configuration
+ for fields via the specification of patterns to match field names.
+ EXAMPLE: name="*_i" will match any field ending in _i (like myid_i, z_i)
+ RESTRICTION: the glob-like pattern in the name attribute must have a "*" only at the start or the end. -->
+
+ <dynamicField name="*_i" type="pint" indexed="true" stored="true"/>
+ <dynamicField name="*_is" type="pints" indexed="true" stored="true"/>
+ <dynamicField name="*_s" type="string" indexed="true" stored="true" />
+ <dynamicField name="*_ss" type="strings" indexed="true" stored="true"/>
+ <dynamicField name="*_l" type="plong" indexed="true" stored="true"/>
+ <dynamicField name="*_ls" type="plongs" indexed="true" stored="true"/>
+ <dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
+ <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
+ <dynamicField name="*_bs" type="booleans" indexed="true" stored="true"/>
+ <dynamicField name="*_f" type="pfloat" indexed="true" stored="true"/>
+ <dynamicField name="*_fs" type="pfloats" indexed="true" stored="true"/>
+ <dynamicField name="*_d" type="pdouble" indexed="true" stored="true"/>
+ <dynamicField name="*_ds" type="pdoubles" indexed="true" stored="true"/>
+
+ <!-- Type used for data-driven schema, to add a string copy for each text field -->
+ <dynamicField name="*_str" type="strings" stored="false" docValues="true" indexed="false" />
+
+ <dynamicField name="*_dt" type="pdate" indexed="true" stored="true"/>
+ <dynamicField name="*_dts" type="pdate" indexed="true" stored="true" multiValued="true"/>
+ <dynamicField name="*_p" type="location" indexed="true" stored="true"/>
+ <dynamicField name="*_srpt" type="location_rpt" indexed="true" stored="true"/>
+
+ <!-- payloaded dynamic fields -->
+ <dynamicField name="*_dpf" type="delimited_payloads_float" indexed="true" stored="true"/>
+ <dynamicField name="*_dpi" type="delimited_payloads_int" indexed="true" stored="true"/>
+ <dynamicField name="*_dps" type="delimited_payloads_string" indexed="true" stored="true"/>
+
+ <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
+
+ <!-- Field to use to determine and enforce document uniqueness.
+ Unless this field is marked with required="false", it will be a required field
+ -->
+ <uniqueKey>id</uniqueKey>
+
+ <!-- copyField commands copy one field to another at the time a document
+ is added to the index. It's used either to index the same field differently,
+ or to add multiple fields to the same field for easier/faster searching.
+
+ <copyField source="sourceFieldName" dest="destinationFieldName"/>
+ -->
+
+ <!-- field type definitions. The "name" attribute is
+ just a label to be used by field definitions. The "class"
+ attribute and any other attributes determine the real
+ behavior of the fieldType.
+ Class names starting with "solr" refer to java classes in a
+ standard package such as org.apache.solr.analysis
+ -->
+
+ <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
+ currently supported on types that are sorted internally as strings
+ and on numeric types.
+ This includes "string", "boolean", "pint", "pfloat", "plong", "pdate", "pdouble".
+ - If sortMissingLast="true", then a sort on this field will cause documents
+ without the field to come after documents with the field,
+ regardless of the requested sort order (asc or desc).
+ - If sortMissingFirst="true", then a sort on this field will cause documents
+ without the field to come before documents with the field,
+ regardless of the requested sort order.
+ - If sortMissingLast="false" and sortMissingFirst="false" (the default),
+ then default lucene sorting will be used which places docs without the
+ field first in an ascending sort and last in a descending sort.
+ -->
+
+ <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
+ <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" />
+ <fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" docValues="true" />
+
+ <!-- boolean type: "true" or "false" -->
+ <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
+ <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
+
+ <!--
+ Numeric field types that index values using KD-trees.
+ Point fields don't support FieldCache, so they must have docValues="true" if needed for sorting, faceting, functions, etc.
+ -->
+ <fieldType name="pint" class="solr.IntPointField" docValues="true"/>
+ <fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
+ <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
+ <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
+
+ <fieldType name="pints" class="solr.IntPointField" docValues="true" multiValued="true"/>
+ <fieldType name="pfloats" class="solr.FloatPointField" docValues="true" multiValued="true"/>
+ <fieldType name="plongs" class="solr.LongPointField" docValues="true" multiValued="true"/>
+ <fieldType name="pdoubles" class="solr.DoublePointField" docValues="true" multiValued="true"/>
+
+ <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
+ is a more restricted form of the canonical representation of dateTime
+ http://www.w3.org/TR/xmlschema-2/#dateTime
+ The trailing "Z" designates UTC time and is mandatory.
+ Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
+ All other components are mandatory.
+
+ Expressions can also be used to denote calculations that should be
+ performed relative to "NOW" to determine the value, ie...
+
+ NOW/HOUR
+ ... Round to the start of the current hour
+ NOW-1DAY
+ ... Exactly 1 day prior to now
+ NOW/DAY+6MONTHS+3DAYS
+ ... 6 months and 3 days in the future from the start of
+ the current day
+
+ -->
+ <!-- KD-tree versions of date fields -->
+ <fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
+ <fieldType name="pdates" class="solr.DatePointField" docValues="true" multiValued="true"/>
+
+ <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
+ <fieldType name="binary" class="solr.BinaryField"/>
+
+ <!-- solr.TextField allows the specification of custom text analyzers
+ specified as a tokenizer and a list of token filters. Different
+ analyzers may be specified for indexing and querying.
+
+ The optional positionIncrementGap puts space between multiple fields of
+ this type on the same document, with the purpose of preventing false phrase
+ matching across fields.
+
+ For more info on customizing your analyzer chain, please see
+ http://lucene.apache.org/solr/guide/understanding-analyzers-tokenizers-and-filters.html#understanding-analyzers-tokenizers-and-filters
+ -->
+
+ <!-- One can also specify an existing Analyzer class that has a
+ default constructor via the class attribute on the analyzer element.
+ Example:
+ <fieldType name="text_greek" class="solr.TextField">
+ <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
+ </fieldType>
+ -->
+
+ <!-- A text field that only splits on whitespace for exact matching of words -->
+ <dynamicField name="*_ws" type="text_ws" indexed="true" stored="true"/>
+ <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
+ <analyzer>
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ </analyzer>
+ </fieldType>
+
+ <!-- A general text field that has reasonable, generic
+ cross-language defaults: it tokenizes with StandardTokenizer,
+ removes stop words from case-insensitive "stopwords.txt"
+ (empty by default), and down cases. At query time only, it
+ also applies synonyms.
+ -->
+ <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
+ <analyzer type="index">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <!-- in this example, we will only use synonyms at query time
+ <filter class="solr.SynonymGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
+ <filter class="solr.FlattenGraphFilterFactory"/>
+ -->
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
+ <!-- Just like text_general except it reverses the characters of
+ each token, to enable more efficient leading wildcard queries.
+ -->
+ <dynamicField name="*_txt_rev" type="text_general_rev" indexed="true" stored="true"/>
+ <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
+ <analyzer type="index">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.LowerCaseFilterFactory"/>
+ <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
+ maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
+ <dynamicField name="*_phon_en" type="phonetic_en" indexed="true" stored="true"/>
+ <fieldType name="phonetic_en" stored="false" indexed="true" class="solr.TextField" >
+ <analyzer>
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
+ </analyzer>
+ </fieldType>
+
+ <!-- lowercases the entire field value, keeping it as a single token. -->
+ <dynamicField name="*_s_lower" type="lowercase" indexed="true" stored="true"/>
+ <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
+ <analyzer>
+ <tokenizer class="solr.KeywordTokenizerFactory"/>
+ <filter class="solr.LowerCaseFilterFactory" />
+ </analyzer>
+ </fieldType>
+
+ <!--
+ Example of using PathHierarchyTokenizerFactory at index time, so
+ queries for paths match documents at that path, or in descendent paths
+ -->
+ <dynamicField name="*_descendent_path" type="descendent_path" indexed="true" stored="true"/>
+ <fieldType name="descendent_path" class="solr.TextField">
+ <analyzer type="index">
+ <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.KeywordTokenizerFactory" />
+ </analyzer>
+ </fieldType>
+
+ <!--
+ Example of using PathHierarchyTokenizerFactory at query time, so
+ queries for paths match documents at that path, or in ancestor paths
+ -->
+ <dynamicField name="*_ancestor_path" type="ancestor_path" indexed="true" stored="true"/>
+ <fieldType name="ancestor_path" class="solr.TextField">
+ <analyzer type="index">
+ <tokenizer class="solr.KeywordTokenizerFactory" />
+ </analyzer>
+ <analyzer type="query">
+ <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
+ </analyzer>
+ </fieldType>
+
+ <!-- This point type indexes the coordinates as separate fields (subFields)
+ If subFieldType is defined, it references a type, and a dynamic field
+ definition is created matching *___<typename>. Alternately, if
+ subFieldSuffix is defined, that is used to create the subFields.
+ Example: if subFieldType="double", then the coordinates would be
+ indexed in fields myloc_0___double,myloc_1___double.
+ Example: if subFieldSuffix="_d" then the coordinates would be indexed
+ in fields myloc_0_d,myloc_1_d
+ The subFields are an implementation detail of the fieldType, and end
+ users normally should not need to know about them.
+ -->
+ <dynamicField name="*_point" type="point" indexed="true" stored="true"/>
+ <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
+
+ <!-- A specialized field for geospatial search filters and distance sorting. -->
+ <fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>
+
+ <!-- A geospatial field type that supports multiValued and polygon shapes.
+ For more information about this and other spatial fields see:
+ http://lucene.apache.org/solr/guide/spatial-search.html
+ -->
+ <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
+ geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
+
+ <!-- Payloaded field types -->
+ <fieldType name="delimited_payloads_float" stored="false" indexed="true" class="solr.TextField">
+ <analyzer>
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
+ </analyzer>
+ </fieldType>
+ <fieldType name="delimited_payloads_int" stored="false" indexed="true" class="solr.TextField">
+ <analyzer>
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="integer"/>
+ </analyzer>
+ </fieldType>
+ <fieldType name="delimited_payloads_string" stored="false" indexed="true" class="solr.TextField">
+ <analyzer>
+ <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+ <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="identity"/>
+ </analyzer>
+ </fieldType>
+
+ <!-- Similarity is the scoring routine for each document vs. a query.
+ A custom Similarity or SimilarityFactory may be specified here, but
+ the default is fine for most applications.
+ For more info: http://lucene.apache.org/solr/guide/other-schema-elements.html#OtherSchemaElements-Similarity
+ -->
+ <!--
+ <similarity class="com.example.solr.CustomSimilarityFactory">
+ <str name="paramkey">param value</str>
+ </similarity>
+ -->
+
+</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml
new file mode 100644
index 0000000..72c5430
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+
+ <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+
+ <dataDir>${solr.data.dir:}</dataDir>
+
+ <directoryFactory name="DirectoryFactory"
+ class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
+
+ <codecFactory class="solr.SchemaCodecFactory"/>
+
+ <indexConfig>
+ <lockType>${solr.lock.type:native}</lockType>
+ </indexConfig>
+
+ <jmx />
+
+ <updateHandler class="solr.DirectUpdateHandler2">
+
+ <updateLog>
+ <str name="dir">${solr.ulog.dir:}</str>
+ <int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int>
+ </updateLog>
+
+ <autoCommit>
+ <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
+ <openSearcher>false</openSearcher>
+ </autoCommit>
+
+ <autoSoftCommit>
+ <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
+ </autoSoftCommit>
+
+ </updateHandler>
+
+ <query>
+
+ <maxBooleanClauses>1024</maxBooleanClauses>
+
+ <filterCache class="solr.FastLRUCache"
+ size="512"
+ initialSize="512"
+ autowarmCount="0"/>
+
+ <queryResultCache class="solr.LRUCache"
+ size="512"
+ initialSize="512"
+ autowarmCount="0"/>
+
+ <documentCache class="solr.LRUCache"
+ size="512"
+ initialSize="512"
+ autowarmCount="0"/>
+
+ <cache name="perSegFilter"
+ class="solr.search.LRUCache"
+ size="10"
+ initialSize="0"
+ autowarmCount="10"
+ regenerator="solr.NoOpRegenerator" />
+
+ <enableLazyFieldLoading>true</enableLazyFieldLoading>
+
+ <queryResultWindowSize>20</queryResultWindowSize>
+
+ <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
+
+ <listener event="newSearcher" class="solr.QuerySenderListener">
+ <arr name="queries">
+ </arr>
+ </listener>
+ <listener event="firstSearcher" class="solr.QuerySenderListener">
+ <arr name="queries">
+ </arr>
+ </listener>
+
+ <useColdSearcher>false</useColdSearcher>
+
+ </query>
+
+ <requestDispatcher>
+
+ <httpCaching never304="true" />
+
+ </requestDispatcher>
+
+ <!-- Request Handlers
+
+ http://wiki.apache.org/solr/SolrRequestHandler
+
+ Incoming queries will be dispatched to a specific handler by name
+ based on the path specified in the request.
+
+ If a Request Handler is declared with startup="lazy", then it will
+ not be initialized until the first request that uses it.
+
+ -->
+ <!-- SearchHandler
+
+ http://wiki.apache.org/solr/SearchHandler
+
+ For processing Search Queries, the primary Request Handler
+ provided with Solr is "SearchHandler" It delegates to a sequent
+ of SearchComponents (see below) and supports distributed
+ queries across multiple shards
+ -->
+ <requestHandler name="/select" class="solr.SearchHandler">
+ <lst name="defaults">
+ <str name="echoParams">explicit</str>
+ <int name="rows">10</int>
+ </lst>
+ </requestHandler>
+
+ <!-- Update Processors
+
+ Chains of Update Processor Factories for dealing with Update
+ Requests can be declared, and then used by name in Update
+ Request Processors
+
+ http://wiki.apache.org/solr/UpdateRequestProcessor
+
+ -->
+
+ <!-- Add unknown fields to the schema
+
+ Field type guessing update processors that will
+ attempt to parse string-typed field values as Booleans, Longs,
+ Doubles, or Dates, and then add schema fields with the guessed
+ field types. Text content will be indexed as "text_general" as
+ well as a copy to a plain string version in *_str.
+
+ These require that the schema is both managed and mutable, by
+ declaring schemaFactory as ManagedIndexSchemaFactory, with
+ mutable specified as true.
+
+ See http://wiki.apache.org/solr/GuessingFieldTypes
+ -->
+ <updateProcessor class="solr.UUIDUpdateProcessorFactory" name="uuid"/>
+ <updateProcessor class="solr.RemoveBlankFieldUpdateProcessorFactory" name="remove-blank"/>
+ <updateProcessor class="solr.FieldNameMutatingUpdateProcessorFactory" name="field-name-mutating">
+ <str name="pattern">[^\w-\.]</str>
+ <str name="replacement">_</str>
+ </updateProcessor>
+ <updateProcessor class="solr.ParseBooleanFieldUpdateProcessorFactory" name="parse-boolean"/>
+ <updateProcessor class="solr.ParseLongFieldUpdateProcessorFactory" name="parse-long"/>
+ <updateProcessor class="solr.ParseDoubleFieldUpdateProcessorFactory" name="parse-double"/>
+ <updateProcessor class="solr.ParseDateFieldUpdateProcessorFactory" name="parse-date">
+ <arr name="format">
+ <str>yyyy-MM-dd'T'HH:mm:ss.SSSZ</str>
+ <str>yyyy-MM-dd'T'HH:mm:ss,SSSZ</str>
+ <str>yyyy-MM-dd'T'HH:mm:ss.SSS</str>
+ <str>yyyy-MM-dd'T'HH:mm:ss,SSS</str>
+ <str>yyyy-MM-dd'T'HH:mm:ssZ</str>
+ <str>yyyy-MM-dd'T'HH:mm:ss</str>
+ <str>yyyy-MM-dd'T'HH:mmZ</str>
+ <str>yyyy-MM-dd'T'HH:mm</str>
+ <str>yyyy-MM-dd HH:mm:ss.SSSZ</str>
+ <str>yyyy-MM-dd HH:mm:ss,SSSZ</str>
+ <str>yyyy-MM-dd HH:mm:ss.SSS</str>
+ <str>yyyy-MM-dd HH:mm:ss,SSS</str>
+ <str>yyyy-MM-dd HH:mm:ssZ</str>
+ <str>yyyy-MM-dd HH:mm:ss</str>
+ <str>yyyy-MM-dd HH:mmZ</str>
+ <str>yyyy-MM-dd HH:mm</str>
+ <str>yyyy-MM-dd</str>
+ </arr>
+ </updateProcessor>
+ <updateProcessor class="solr.AddSchemaFieldsUpdateProcessorFactory" name="add-schema-fields">
+ <lst name="typeMapping">
+ <str name="valueClass">java.lang.String</str>
+ <str name="fieldType">text_general</str>
+ <lst name="copyField">
+ <str name="dest">*_str</str>
+ <int name="maxChars">256</int>
+ </lst>
+ <!-- Use as default mapping instead of defaultFieldType -->
+ <bool name="default">true</bool>
+ </lst>
+ <lst name="typeMapping">
+ <str name="valueClass">java.lang.Boolean</str>
+ <str name="fieldType">booleans</str>
+ </lst>
+ <lst name="typeMapping">
+ <str name="valueClass">java.util.Date</str>
+ <str name="fieldType">pdates</str>
+ </lst>
+ <lst name="typeMapping">
+ <str name="valueClass">java.lang.Long</str>
+ <str name="valueClass">java.lang.Integer</str>
+ <str name="fieldType">plongs</str>
+ </lst>
+ <lst name="typeMapping">
+ <str name="valueClass">java.lang.Number</str>
+ <str name="fieldType">pdoubles</str>
+ </lst>
+ </updateProcessor>
+
+ <!-- The update.autoCreateFields property can be turned to false to disable schemaless mode -->
+ <updateRequestProcessorChain name="add-unknown-fields-to-the-schema" default="${update.autoCreateFields:true}"
+ processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date,add-schema-fields">
+ <processor class="solr.LogUpdateProcessorFactory"/>
+ <processor class="solr.DistributedUpdateProcessorFactory"/>
+ <processor class="solr.RunUpdateProcessorFactory"/>
+ </updateRequestProcessorChain>
+
+ <queryResponseWriter name="json" class="solr.JSONResponseWriter">
+ <!-- For the purposes of the tutorial, JSON responses are written as
+ plain text so that they are easy to read in *any* browser.
+ If you expect a MIME type of "application/json" just remove this override.
+ -->
+ <str name="content-type">text/plain; charset=UTF-8</str>
+ </queryResponseWriter>
+
+</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt
new file mode 100644
index 0000000..ae1e83e
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt
@@ -0,0 +1,14 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt
new file mode 100644
index 0000000..eab4ee8
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt
@@ -0,0 +1,29 @@
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#-----------------------------------------------------------------------
+#some test synonym mappings unlikely to appear in real input text
+aaafoo => aaabar
+bbbfoo => bbbfoo bbbbar
+cccfoo => cccbar cccbaz
+fooaaa,baraaa,bazaaa
+
+# Some synonym groups specific to this example
+GB,gib,gigabyte,gigabytes
+MB,mib,megabyte,megabytes
+Television, Televisions, TV, TVs
+#notice we use "gib" instead of "GiB" so any WordDelimiterGraphFilter coming
+#after us won't split it into two words.
+
+# Synonym mappings can be used for spelling correction too
+pixima => pixma
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml
new file mode 100644
index 0000000..01743d3
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="GB18030"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+ <doc>
+ <field name="id">GB18030TEST</field>
+ <field name="name">Test with some GB18030 encoded characters</field>
+ <field name="features">No accents here</field>
+ <field name="features">����һ������</field>
+ <field name="features">This is a feature (translated)</field>
+ <field name="features">����ļ��Ǻ��й���</field>
+ <field name="features">This document is very shiny (translated)</field>
+ <field name="price">0.0</field>
+ <field name="inStock">true</field>
+ </doc>
+</add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml
new file mode 100644
index 0000000..9cf7d1b
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml
@@ -0,0 +1,56 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+<doc>
+ <field name="id">SP2514N</field>
+ <field name="name">Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133</field>
+ <field name="manu">Samsung Electronics Co. Ltd.</field>
+ <!-- Join -->
+ <field name="manu_id_s">samsung</field>
+ <field name="cat">electronics</field>
+ <field name="cat">hard drive</field>
+ <field name="features">7200RPM, 8MB cache, IDE Ultra ATA-133</field>
+ <field name="features">NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor</field>
+ <field name="price">92.0</field>
+ <field name="popularity">6</field>
+ <field name="inStock">true</field>
+ <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+ <!-- Near Oklahoma city -->
+ <field name="store">35.0752,-97.032</field>
+</doc>
+
+<doc>
+ <field name="id">6H500F0</field>
+ <field name="name">Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300</field>
+ <field name="manu">Maxtor Corp.</field>
+ <!-- Join -->
+ <field name="manu_id_s">maxtor</field>
+ <field name="cat">electronics</field>
+ <field name="cat">hard drive</field>
+ <field name="features">SATA 3.0Gb/s, NCQ</field>
+ <field name="features">8.5ms seek</field>
+ <field name="features">16MB cache</field>
+ <field name="price">350.0</field>
+ <field name="popularity">6</field>
+ <field name="inStock">true</field>
+ <!-- Buffalo store -->
+ <field name="store">45.17614,-93.87341</field>
+ <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+</doc>
+</add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml
new file mode 100644
index 0000000..3de32f3
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml
@@ -0,0 +1,60 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+
+<doc>
+ <field name="id">F8V7067-APL-KIT</field>
+ <field name="name">Belkin Mobile Power Cord for iPod w/ Dock</field>
+ <field name="manu">Belkin</field>
+ <!-- Join -->
+ <field name="manu_id_s">belkin</field>
+ <field name="cat">electronics</field>
+ <field name="cat">connector</field>
+ <field name="features">car power adapter, white</field>
+ <field name="weight">4.0</field>
+ <field name="price">19.95</field>
+ <field name="popularity">1</field>
+ <field name="inStock">false</field>
+ <!-- Buffalo store -->
+ <field name="store">45.18014,-93.87741</field>
+ <field name="manufacturedate_dt">2005-08-01T16:30:25Z</field>
+</doc>
+
+<doc>
+ <field name="id">IW-02</field>
+ <field name="name">iPod & iPod Mini USB 2.0 Cable</field>
+ <field name="manu">Belkin</field>
+ <!-- Join -->
+ <field name="manu_id_s">belkin</field>
+ <field name="cat">electronics</field>
+ <field name="cat">connector</field>
+ <field name="features">car power adapter for iPod, white</field>
+ <field name="weight">2.0</field>
+ <field name="price">11.50</field>
+ <field name="popularity">1</field>
+ <field name="inStock">false</field>
+ <!-- San Francisco store -->
+ <field name="store">37.7752,-122.4232</field>
+ <field name="manufacturedate_dt">2006-02-14T23:55:59Z</field>
+</doc>
+
+
+</add>
+
+
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml
new file mode 100644
index 0000000..1ca5f6f
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml
@@ -0,0 +1,40 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+ <field name="id">MA147LL/A</field>
+ <field name="name">Apple 60 GB iPod with Video Playback Black</field>
+ <field name="manu">Apple Computer Inc.</field>
+ <!-- Join -->
+ <field name="manu_id_s">apple</field>
+ <field name="cat">electronics</field>
+ <field name="cat">music</field>
+ <field name="features">iTunes, Podcasts, Audiobooks</field>
+ <field name="features">Stores up to 15,000 songs, 25,000 photos, or 150 hours of video</field>
+ <field name="features">2.5-inch, 320x240 color TFT LCD display with LED backlight</field>
+ <field name="features">Up to 20 hours of battery life</field>
+ <field name="features">Plays AAC, MP3, WAV, AIFF, Audible, Apple Lossless, H.264 video</field>
+ <field name="features">Notes, Calendar, Phone book, Hold button, Date display, Photo wallet, Built-in games, JPEG photo playback, Upgradeable firmware, USB 2.0 compatibility, Playback speed control, Rechargeable capability, Battery level indication</field>
+ <field name="includes">earbud headphones, USB cable</field>
+ <field name="weight">5.5</field>
+ <field name="price">399.00</field>
+ <field name="popularity">10</field>
+ <field name="inStock">true</field>
+ <!-- Dodge City store -->
+ <field name="store">37.7752,-100.0232</field>
+ <field name="manufacturedate_dt">2005-10-12T08:00:00Z</field>
+</doc></add>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml
new file mode 100644
index 0000000..e3121d5
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml
@@ -0,0 +1,75 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+ <doc>
+ <field name="id">adata</field>
+ <field name="compName_s">A-Data Technology</field>
+ <field name="address_s">46221 Landing Parkway Fremont, CA 94538</field>
+ </doc>
+ <doc>
+ <field name="id">apple</field>
+ <field name="compName_s">Apple</field>
+ <field name="address_s">1 Infinite Way, Cupertino CA</field>
+ </doc>
+ <doc>
+ <field name="id">asus</field>
+ <field name="compName_s">ASUS Computer</field>
+ <field name="address_s">800 Corporate Way Fremont, CA 94539</field>
+ </doc>
+ <doc>
+ <field name="id">ati</field>
+ <field name="compName_s">ATI Technologies</field>
+ <field name="address_s">33 Commerce Valley Drive East Thornhill, ON L3T 7N6 Canada</field>
+ </doc>
+ <doc>
+ <field name="id">belkin</field>
+ <field name="compName_s">Belkin</field>
+ <field name="address_s">12045 E. Waterfront Drive Playa Vista, CA 90094</field>
+ </doc>
+ <doc>
+ <field name="id">canon</field>
+ <field name="compName_s">Canon, Inc.</field>
+ <field name="address_s">One Canon Plaza Lake Success, NY 11042</field>
+ </doc>
+ <doc>
+ <field name="id">corsair</field>
+ <field name="compName_s">Corsair Microsystems</field>
+ <field name="address_s">46221 Landing Parkway Fremont, CA 94538</field>
+ </doc>
+ <doc>
+ <field name="id">dell</field>
+ <field name="compName_s">Dell, Inc.</field>
+ <field name="address_s">One Dell Way Round Rock, Texas 78682</field>
+ </doc>
+ <doc>
+ <field name="id">maxtor</field>
+ <field name="compName_s">Maxtor Corporation</field>
+ <field name="address_s">920 Disc Drive Scotts Valley, CA 95066</field>
+ </doc>
+ <doc>
+ <field name="id">samsung</field>
+ <field name="compName_s">Samsung Electronics Co. Ltd.</field>
+ <field name="address_s">105 Challenger Rd. Ridgefield Park, NJ 07660-0511</field>
+ </doc>
+ <doc>
+ <field name="id">viewsonic</field>
+ <field name="compName_s">ViewSonic Corp</field>
+ <field name="address_s">381 Brea Canyon Road Walnut, CA 91789-0708</field>
+ </doc>
+</add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml
new file mode 100644
index 0000000..48af522
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml
@@ -0,0 +1,77 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+<doc>
+ <field name="id">TWINX2048-3200PRO</field>
+ <field name="name">CORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail</field>
+ <field name="manu">Corsair Microsystems Inc.</field>
+ <!-- Join -->
+ <field name="manu_id_s">corsair</field>
+ <field name="cat">electronics</field>
+ <field name="cat">memory</field>
+ <field name="features">CAS latency 2, 2-3-3-6 timing, 2.75v, unbuffered, heat-spreader</field>
+ <field name="price">185.00</field>
+ <field name="popularity">5</field>
+ <field name="inStock">true</field>
+ <!-- San Francisco store -->
+ <field name="store">37.7752,-122.4232</field>
+ <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+
+ <!-- a field for testing payload tagged text via DelimitedPayloadTokenFilter -->
+ <field name="payloads">electronics|6.0 memory|3.0</field>
+</doc>
+
+<doc>
+ <field name="id">VS1GB400C3</field>
+ <field name="name">CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail</field>
+ <field name="manu">Corsair Microsystems Inc.</field>
+ <!-- Join -->
+ <field name="manu_id_s">corsair</field>
+ <field name="cat">electronics</field>
+ <field name="cat">memory</field>
+ <field name="price">74.99</field>
+ <field name="popularity">7</field>
+ <field name="inStock">true</field>
+ <!-- Dodge City store -->
+ <field name="store">37.7752,-100.0232</field>
+ <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+
+ <field name="payloads">electronics|4.0 memory|2.0</field>
+</doc>
+
+<doc>
+ <field name="id">VDBDB1A16</field>
+ <field name="name">A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM</field>
+ <field name="manu">A-DATA Technology Inc.</field>
+ <!-- Join -->
+ <field name="manu_id_s">corsair</field>
+ <field name="cat">electronics</field>
+ <field name="cat">memory</field>
+ <field name="features">CAS latency 3, 2.7v</field>
+ <!-- note: price & popularity is missing on this one -->
+ <field name="popularity">0</field>
+ <field name="inStock">true</field>
+ <!-- Buffalo store -->
+ <field name="store">45.18414,-93.88141</field>
+ <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+
+ <field name="payloads">electronics|0.9 memory|0.1</field>
+</doc>
+
+</add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml
new file mode 100644
index 0000000..b1b8036
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml
@@ -0,0 +1,65 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Example documents utilizing the CurrencyField type -->
+<add>
+<doc>
+ <field name="id">USD</field>
+ <field name="name">One Dollar</field>
+ <field name="manu">Bank of America</field>
+ <field name="manu_id_s">boa</field>
+ <field name="cat">currency</field>
+ <field name="features">Coins and notes</field>
+ <field name="price_c">1,USD</field>
+ <field name="inStock">true</field>
+</doc>
+
+<doc>
+ <field name="id">EUR</field>
+ <field name="name">One Euro</field>
+ <field name="manu">European Union</field>
+ <field name="manu_id_s">eu</field>
+ <field name="cat">currency</field>
+ <field name="features">Coins and notes</field>
+ <field name="price_c">1,EUR</field>
+ <field name="inStock">true</field>
+</doc>
+
+<doc>
+ <field name="id">GBP</field>
+ <field name="name">One British Pound</field>
+ <field name="manu">U.K.</field>
+ <field name="manu_id_s">uk</field>
+ <field name="cat">currency</field>
+ <field name="features">Coins and notes</field>
+ <field name="price_c">1,GBP</field>
+ <field name="inStock">true</field>
+</doc>
+
+<doc>
+ <field name="id">NOK</field>
+ <field name="name">One Krone</field>
+ <field name="manu">Bank of Norway</field>
+ <field name="manu_id_s">nor</field>
+ <field name="cat">currency</field>
+ <field name="features">Coins and notes</field>
+ <field name="price_c">1,NOK</field>
+ <field name="inStock">true</field>
+</doc>
+
+</add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml
new file mode 100644
index 0000000..d0343af
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+ <field name="id">3007WFP</field>
+ <field name="name">Dell Widescreen UltraSharp 3007WFP</field>
+ <field name="manu">Dell, Inc.</field>
+ <!-- Join -->
+ <field name="manu_id_s">dell</field>
+ <field name="cat">electronics and computer1</field>
+ <field name="features">30" TFT active matrix LCD, 2560 x 1600, .25mm dot pitch, 700:1 contrast</field>
+ <field name="includes">USB cable</field>
+ <field name="weight">401.6</field>
+ <field name="price">2199.0</field>
+ <field name="popularity">6</field>
+ <field name="inStock">true</field>
+ <!-- Buffalo store -->
+ <field name="store">43.17614,-90.57341</field>
+</doc></add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml
new file mode 100644
index 0000000..eaf9e22
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml
@@ -0,0 +1,33 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+ <field name="id">VA902B</field>
+ <field name="name">ViewSonic VA902B - flat panel display - TFT - 19"</field>
+ <field name="manu">ViewSonic Corp.</field>
+ <!-- Join -->
+ <field name="manu_id_s">viewsonic</field>
+ <field name="cat">electronics and stuff2</field>
+ <field name="features">19" TFT active matrix LCD, 8ms response time, 1280 x 1024 native resolution</field>
+ <field name="weight">190.4</field>
+ <field name="price">279.95</field>
+ <field name="popularity">6</field>
+ <field name="inStock">true</field>
+ <!-- Buffalo store -->
+ <field name="store">45.18814,-93.88541</field>
+</doc></add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml
new file mode 100644
index 0000000..a8f51b6
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml
@@ -0,0 +1,43 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+ <field name="id">0579B002</field>
+ <field name="name">Canon PIXMA MP500 All-In-One Photo Printer</field>
+ <field name="manu">Canon Inc.</field>
+ <!-- Join -->
+ <field name="manu_id_s">canon</field>
+ <field name="cat">electronics</field>
+ <field name="cat">multifunction printer</field>
+ <field name="cat">printer</field>
+ <field name="cat">scanner</field>
+ <field name="cat">copier</field>
+ <field name="features">Multifunction ink-jet color photo printer</field>
+ <field name="features">Flatbed scanner, optical scan resolution of 1,200 x 2,400 dpi</field>
+ <field name="features">2.5" color LCD preview screen</field>
+ <field name="features">Duplex Copying</field>
+ <field name="features">Printing speed up to 29ppm black, 19ppm color</field>
+ <field name="features">Hi-Speed USB</field>
+ <field name="features">memory card: CompactFlash, Micro Drive, SmartMedia, Memory Stick, Memory Stick Pro, SD Card, and MultiMediaCard</field>
+ <field name="weight">352.0</field>
+ <field name="price">179.99</field>
+ <field name="popularity">6</field>
+ <field name="inStock">true</field>
+ <!-- Buffalo store -->
+ <field name="store">45.19214,-93.89941</field>
+</doc></add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html
new file mode 100644
index 0000000..656b656
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+ <title>Welcome to Solr</title>
+</head>
+<body>
+<p>
+ Here is some text
+</p>
+<p>distinct<br/>words</p>
+<div>Here is some text in a div</div>
+<div>This has a <a href="http://www.apache.org">link</a>.</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml
new file mode 100644
index 0000000..145c6fd
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+ <field name="id">9885A004</field>
+ <field name="name">Canon PowerShot SD500</field>
+ <field name="manu">Canon Inc.</field>
+ <!-- Join -->
+ <field name="manu_id_s">canon</field>
+ <field name="cat">electronics</field>
+ <field name="cat">camera</field>
+ <field name="features">3x zoop, 7.1 megapixel Digital ELPH</field>
+ <field name="features">movie clips up to 640x480 @30 fps</field>
+ <field name="features">2.0" TFT LCD, 118,000 pixels</field>
+ <field name="features">built in flash, red-eye reduction</field>
+ <field name="includes">32MB SD card, USB cable, AV cable, battery</field>
+ <field name="weight">6.4</field>
+ <field name="price">329.95</field>
+ <field name="popularity">7</field>
+ <field name="inStock">true</field>
+ <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+ <!-- Buffalo store -->
+ <field name="store">45.19614,-93.90341</field>
+</doc></add>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml
new file mode 100644
index 0000000..a365617
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+<doc>
+ <field name="id">SOLR1000</field>
+ <field name="name">Solr, the Enterprise Search Server</field>
+ <field name="manu">Apache Software Foundation</field>
+ <field name="cat">software</field>
+ <field name="cat">search</field>
+ <field name="features">Advanced Full-Text Search Capabilities using Lucene</field>
+ <field name="features">Optimized for High Volume Web Traffic</field>
+ <field name="features">Standards Based Open Interfaces - XML and HTTP</field>
+ <field name="features">Comprehensive HTML Administration Interfaces</field>
+ <field name="features">Scalability - Efficient Replication to other Solr Search Servers</field>
+ <field name="features">Flexible and Adaptable with XML configuration and Schema</field>
+ <field name="features">Good unicode support: héllo (hello with an accent over the e)</field>
+ <field name="price">0.0</field>
+ <field name="popularity">10</field>
+ <field name="inStock">true</field>
+ <field name="incubationdate_dt">2006-01-17T00:00:00.000Z</field>
+</doc>
+</add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml
new file mode 100644
index 0000000..ee300a6
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+ After posting this to Solr with bin/post, searching for "êâîôû" from
+ the solr/admin/ search page must return this document.
+ -->
+
+<add>
+ <doc>
+ <field name="id">UTF8TEST</field>
+ <field name="name">Test with some UTF-8 encoded characters</field>
+ <field name="manu">Apache Software Foundation</field>
+ <field name="cat">software</field>
+ <field name="cat">search</field>
+ <field name="features">No accents here</field>
+ <field name="features">This is an e acute: é</field>
+ <field name="features">eaiou with circumflexes: êâîôû</field>
+ <field name="features">eaiou with umlauts: ëäïöü</field>
+ <field name="features">tag with escaped chars: <nicetag/></field>
+ <field name="features">escaped ampersand: Bonnie & Clyde</field>
+ <field name="features">Outside the BMP:𐌈 codepoint=10308, a circle with an x inside. UTF8=f0908c88 UTF16=d800 df08</field>
+ <field name="price">0.0</field>
+ <field name="inStock">true</field>
+ </doc>
+</add>
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml
new file mode 100644
index 0000000..d867d82
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml
@@ -0,0 +1,62 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+<doc>
+ <field name="id">EN7800GTX/2DHTV/256M</field>
+ <field name="name">ASUS Extreme N7800GTX/2DHTV (256 MB)</field>
+ <!-- Denormalized -->
+ <field name="manu">ASUS Computer Inc.</field>
+ <!-- Join -->
+ <field name="manu_id_s">asus</field>
+ <field name="cat">electronics</field>
+ <field name="cat">graphics card</field>
+ <field name="features">NVIDIA GeForce 7800 GTX GPU/VPU clocked at 486MHz</field>
+ <field name="features">256MB GDDR3 Memory clocked at 1.35GHz</field>
+ <field name="features">PCI Express x16</field>
+ <field name="features">Dual DVI connectors, HDTV out, video input</field>
+ <field name="features">OpenGL 2.0, DirectX 9.0</field>
+ <field name="weight">16.0</field>
+ <field name="price">479.95</field>
+ <field name="popularity">7</field>
+ <field name="store">40.7143,-74.006</field>
+ <field name="inStock">false</field>
+ <field name="manufacturedate_dt">2006-02-13T15:26:37Z/DAY</field>
+</doc>
+ <!-- yes, you can add more than one document at a time -->
+<doc>
+ <field name="id">100-435805</field>
+ <field name="name">ATI Radeon X1900 XTX 512 MB PCIE Video Card</field>
+ <field name="manu">ATI Technologies</field>
+ <!-- Join -->
+ <field name="manu_id_s">ati</field>
+ <field name="cat">electronics</field>
+ <field name="cat">graphics card</field>
+ <field name="features">ATI RADEON X1900 GPU/VPU clocked at 650MHz</field>
+ <field name="features">512MB GDDR3 SDRAM clocked at 1.55GHz</field>
+ <field name="features">PCI Express x16</field>
+ <field name="features">dual DVI, HDTV, svideo, composite out</field>
+ <field name="features">OpenGL 2.0, DirectX 9.0</field>
+ <field name="weight">48.0</field>
+ <field name="price">649.99</field>
+ <field name="popularity">7</field>
+ <field name="inStock">false</field>
+ <field name="manufacturedate_dt">2006-02-13T15:26:37Z/DAY</field>
+ <!-- NYC store -->
+ <field name="store">40.7143,-74.006</field>
+</doc>
+</add>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java
new file mode 100644
index 0000000..676f8ab
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.collector;
+
+import org.apache.solr.core.Config;
+import org.apache.solr.core.SolrResourceLoader;
+import org.apache.solr.prometheus.exporter.SolrExporter;
+import org.apache.solr.prometheus.exporter.SolrExporterTestBase;
+import io.prometheus.client.CollectorRegistry;
+import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
+import org.junit.Test;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Unit test for SolrCollector.
+ */
+@Slow
+public class SolrCollectorTest extends SolrExporterTestBase {
+ CollectorRegistry registry;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ registry = new CollectorRegistry();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ @Test
+ public void testSolrCollector() throws Exception {
+ String name = "solr-exporter-config.xml";
+ SolrResourceLoader loader = new SolrResourceLoader(getFile("conf/").toPath());
+ Config config = new Config(loader, name);
+
+ CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+ SolrCollector collector = new SolrCollector(cloudSolrClient, config, 1);
+
+ assertNotNull(collector);
+ }
+
+ @Test
+ public void testCollect() throws Exception {
+ String name = "solr-exporter-config.xml";
+ SolrResourceLoader loader = new SolrResourceLoader(getFile("conf/").toPath());
+ Config config = new Config(loader, name);
+
+ CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+ SolrCollector collector = new SolrCollector(cloudSolrClient, config, 1);
+
+ this.registry.register(collector);
+ this.registry.register(SolrExporter.scrapeErrorTotal);
+
+ // index sample docs
+ File exampleDocsDir = new File(getFile("exampledocs").getAbsolutePath());
+ List<File> xmlFiles = Arrays.asList(exampleDocsDir.listFiles((dir, file) -> file.endsWith(".xml")));
+ for (File xml : xmlFiles) {
+ ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update");
+ req.addFile(xml, "application/xml");
+ cloudSolrClient.request(req, "collection1");
+ }
+ cloudSolrClient.commit("collection1");
+
+ // collect metrics
+ collector.collect();
+
+ // check scrape error count
+ assertEquals(0.0, registry.getSampleValue("solr_exporter_scrape_error_total", new String[]{}, new String[]{}), .001);
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java
new file mode 100644
index 0000000..237a6cb
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.exporter;
+
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
+import org.junit.Test;
+
+import java.io.File;
+import java.net.ServerSocket;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Unit test for SolrExporter.
+ */
+@Slow
+public class SolrExporterTest extends SolrExporterTestBase {
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ @Test
+ public void testExecute() throws Exception {
+ // solr client
+ CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+ int port;
+ ServerSocket socket = null;
+ try {
+ socket = new ServerSocket(0);
+ port = socket.getLocalPort();
+ } finally {
+ socket.close();
+ }
+
+ // index sample docs
+ File exampleDocsDir = new File(getFile("exampledocs").getAbsolutePath());
+ List<File> xmlFiles = Arrays.asList(exampleDocsDir.listFiles((dir, name) -> name.endsWith(".xml")));
+ for (File xml : xmlFiles) {
+ ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update");
+ req.addFile(xml, "application/xml");
+ cloudSolrClient.request(req, "collection1");
+ }
+ cloudSolrClient.commit("collection1");
+
+ // start exporter
+ SolrExporter solrExporter = new SolrExporter(port, cloudSolrClient, getFile("conf/solr-exporter-config.xml").toPath(), 1);
+ try {
+ solrExporter.start();
+
+ URI uri = new URI("http://localhost:" + String.valueOf(port) + "/metrics");
+
+ CloseableHttpClient httpclient = HttpClients.createDefault();
+ CloseableHttpResponse response = null;
+ try {
+ HttpGet request = new HttpGet(uri);
+ response = httpclient.execute(request);
+
+ int expectedHTTPStatusCode = HttpStatus.SC_OK;
+ int actualHTTPStatusCode = response.getStatusLine().getStatusCode();
+ assertEquals(expectedHTTPStatusCode, actualHTTPStatusCode);
+ } finally {
+ response.close();
+ httpclient.close();
+ }
+ } finally {
+ solrExporter.stop();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java
new file mode 100644
index 0000000..57ba8e0
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.exporter;
+
+import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.cloud.AbstractDistribZkTestBase;
+import org.apache.solr.cloud.SolrCloudTestCase;
+import org.junit.BeforeClass;
+
+/**
+ * Test base class.
+ */
+@ThreadLeakScope(ThreadLeakScope.Scope.NONE)
+public class SolrExporterTestBase extends SolrCloudTestCase {
+ public static String COLLECTION = "collection1";
+ public static String CONF_NAME = COLLECTION + "_config";
+ public static String CONF_DIR = getFile("configsets/" + COLLECTION + "/conf").getAbsolutePath();
+ public static int NUM_SHARDS = 2;
+ public static int NUM_REPLICAS = 2;
+ public static int MAX_SHARDS_PER_NODE = 1;
+ public static int NUM_NODES = (NUM_SHARDS * NUM_REPLICAS + (MAX_SHARDS_PER_NODE - 1)) / MAX_SHARDS_PER_NODE;
+ public static int TIMEOUT = 60;
+
+ @BeforeClass
+ public static void setupCluster() throws Exception {
+ configureCluster(NUM_NODES)
+ .addConfig(CONF_NAME, getFile(CONF_DIR).toPath())
+ .configure();
+
+ CollectionAdminRequest
+ .createCollection(COLLECTION, CONF_NAME, NUM_SHARDS, NUM_REPLICAS)
+ .setMaxShardsPerNode(MAX_SHARDS_PER_NODE)
+ .process(cluster.getSolrClient());
+
+ AbstractDistribZkTestBase
+ .waitForRecoveriesToFinish(COLLECTION, cluster.getSolrClient().getZkStateReader(), true, true, TIMEOUT);
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/licenses/argparse4j-0.8.1.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/argparse4j-0.8.1.jar.sha1 b/solr/licenses/argparse4j-0.8.1.jar.sha1
new file mode 100644
index 0000000..27a0568
--- /dev/null
+++ b/solr/licenses/argparse4j-0.8.1.jar.sha1
@@ -0,0 +1 @@
+2c8241f84acf6c924bd75be0dbd68e8d74fbcd70
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/licenses/argparse4j-LICENSE-MIT.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/argparse4j-LICENSE-MIT.txt b/solr/licenses/argparse4j-LICENSE-MIT.txt
new file mode 100644
index 0000000..2354213
--- /dev/null
+++ b/solr/licenses/argparse4j-LICENSE-MIT.txt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2011-2017 Tatsuhiro Tsujikawa
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/licenses/argparse4j-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/argparse4j-NOTICE.txt b/solr/licenses/argparse4j-NOTICE.txt
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/licenses/jackson-jq-0.0.8.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/jackson-jq-0.0.8.jar.sha1 b/solr/licenses/jackson-jq-0.0.8.jar.sha1
new file mode 100644
index 0000000..4b7a4d2
--- /dev/null
+++ b/solr/licenses/jackson-jq-0.0.8.jar.sha1
@@ -0,0 +1 @@
+9bd1a7f8268a436674a4f3210f11ef4eebe14d84
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/licenses/jackson-jq-LICENSE-ASL.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/jackson-jq-LICENSE-ASL.txt b/solr/licenses/jackson-jq-LICENSE-ASL.txt
new file mode 100644
index 0000000..8fd4d51
--- /dev/null
+++ b/solr/licenses/jackson-jq-LICENSE-ASL.txt
@@ -0,0 +1,16 @@
+jackson-jq
+----------
+
+Copyright (C) 2015 Eiichi Sato
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/licenses/jackson-jq-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/jackson-jq-NOTICE.txt b/solr/licenses/jackson-jq-NOTICE.txt
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/6d66fc04/solr/licenses/simpleclient-0.2.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient-0.2.0.jar.sha1 b/solr/licenses/simpleclient-0.2.0.jar.sha1
new file mode 100644
index 0000000..ce8b16f
--- /dev/null
+++ b/solr/licenses/simpleclient-0.2.0.jar.sha1
@@ -0,0 +1 @@
+be8de6a5a01f25074be3b27a8db4448c9cce0168