From commits-return-99146-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri Mar 2 03:18:42 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0CDED180671 for ; Fri, 2 Mar 2018 03:18:40 +0100 (CET) Received: (qmail 42569 invoked by uid 500); 2 Mar 2018 02:18:39 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 42540 invoked by uid 99); 2 Mar 2018 02:18:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2018 02:18:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 33004F4E65; Fri, 2 Mar 2018 02:18:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: koji@apache.org To: commits@lucene.apache.org Date: Fri, 02 Mar 2018 02:18:40 -0000 Message-Id: In-Reply-To: <61499e84285a45958dc4d47ea8b7da0f@git.apache.org> References: <61499e84285a45958dc4d47ea8b7da0f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/8] lucene-solr:SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + + ${tests.luceneMatchVersion:LATEST} + + ${solr.data.dir:} + + + + + + + ${solr.lock.type:native} + + + + + + + + ${solr.ulog.dir:} + ${solr.ulog.numVersionBuckets:65536} + + + + ${solr.autoCommit.maxTime:15000} + false + + + + ${solr.autoSoftCommit.maxTime:-1} + + + + + + + 1024 + + + + + + + + + + true + + 20 + + 200 + + + + + + + + + + + false + + + + + + + + + + + + + + explicit + 10 + + + + + + + + + + [^\w-\.] + _ + + + + + + + yyyy-MM-dd'T'HH:mm:ss.SSSZ + yyyy-MM-dd'T'HH:mm:ss,SSSZ + yyyy-MM-dd'T'HH:mm:ss.SSS + yyyy-MM-dd'T'HH:mm:ss,SSS + yyyy-MM-dd'T'HH:mm:ssZ + yyyy-MM-dd'T'HH:mm:ss + yyyy-MM-dd'T'HH:mmZ + yyyy-MM-dd'T'HH:mm + yyyy-MM-dd HH:mm:ss.SSSZ + yyyy-MM-dd HH:mm:ss,SSSZ + yyyy-MM-dd HH:mm:ss.SSS + yyyy-MM-dd HH:mm:ss,SSS + yyyy-MM-dd HH:mm:ssZ + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mmZ + yyyy-MM-dd HH:mm + yyyy-MM-dd + + + + + java.lang.String + text_general + + *_str + 256 + + + true + + + java.lang.Boolean + booleans + + + java.util.Date + pdates + + + java.lang.Long + java.lang.Integer + plongs + + + java.lang.Number + pdoubles + + + + + + + + + + + + + text/plain; charset=UTF-8 + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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/328800ef/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/328800ef/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 @@ + + + + + + GB18030TEST + Test with some GB18030 encoded characters + No accents here + ����һ������ + This is a feature (translated) + ����ļ��Ǻ��й��� + This document is very shiny (translated) + 0.0 + true + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + SP2514N + Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133 + Samsung Electronics Co. Ltd. + + samsung + electronics + hard drive + 7200RPM, 8MB cache, IDE Ultra ATA-133 + NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor + 92.0 + 6 + true + 2006-02-13T15:26:37Z + + 35.0752,-97.032 + + + + 6H500F0 + Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300 + Maxtor Corp. + + maxtor + electronics + hard drive + SATA 3.0Gb/s, NCQ + 8.5ms seek + 16MB cache + 350.0 + 6 + true + + 45.17614,-93.87341 + 2006-02-13T15:26:37Z + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + + F8V7067-APL-KIT + Belkin Mobile Power Cord for iPod w/ Dock + Belkin + + belkin + electronics + connector + car power adapter, white + 4.0 + 19.95 + 1 + false + + 45.18014,-93.87741 + 2005-08-01T16:30:25Z + + + + IW-02 + iPod & iPod Mini USB 2.0 Cable + Belkin + + belkin + electronics + connector + car power adapter for iPod, white + 2.0 + 11.50 + 1 + false + + 37.7752,-122.4232 + 2006-02-14T23:55:59Z + + + + + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + MA147LL/A + Apple 60 GB iPod with Video Playback Black + Apple Computer Inc. + + apple + electronics + music + iTunes, Podcasts, Audiobooks + Stores up to 15,000 songs, 25,000 photos, or 150 hours of video + 2.5-inch, 320x240 color TFT LCD display with LED backlight + Up to 20 hours of battery life + Plays AAC, MP3, WAV, AIFF, Audible, Apple Lossless, H.264 video + 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 + earbud headphones, USB cable + 5.5 + 399.00 + 10 + true + + 37.7752,-100.0232 + 2005-10-12T08:00:00Z + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + adata + A-Data Technology + 46221 Landing Parkway Fremont, CA 94538 + + + apple + Apple + 1 Infinite Way, Cupertino CA + + + asus + ASUS Computer + 800 Corporate Way Fremont, CA 94539 + + + ati + ATI Technologies + 33 Commerce Valley Drive East Thornhill, ON L3T 7N6 Canada + + + belkin + Belkin + 12045 E. Waterfront Drive Playa Vista, CA 90094 + + + canon + Canon, Inc. + One Canon Plaza Lake Success, NY 11042 + + + corsair + Corsair Microsystems + 46221 Landing Parkway Fremont, CA 94538 + + + dell + Dell, Inc. + One Dell Way Round Rock, Texas 78682 + + + maxtor + Maxtor Corporation + 920 Disc Drive Scotts Valley, CA 95066 + + + samsung + Samsung Electronics Co. Ltd. + 105 Challenger Rd. Ridgefield Park, NJ 07660-0511 + + + viewsonic + ViewSonic Corp + 381 Brea Canyon Road Walnut, CA 91789-0708 + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + TWINX2048-3200PRO + CORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail + Corsair Microsystems Inc. + + corsair + electronics + memory + CAS latency 2, 2-3-3-6 timing, 2.75v, unbuffered, heat-spreader + 185.00 + 5 + true + + 37.7752,-122.4232 + 2006-02-13T15:26:37Z + + + electronics|6.0 memory|3.0 + + + + VS1GB400C3 + CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail + Corsair Microsystems Inc. + + corsair + electronics + memory + 74.99 + 7 + true + + 37.7752,-100.0232 + 2006-02-13T15:26:37Z + + electronics|4.0 memory|2.0 + + + + VDBDB1A16 + A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM + A-DATA Technology Inc. + + corsair + electronics + memory + CAS latency 3, 2.7v + + 0 + true + + 45.18414,-93.88141 + 2006-02-13T15:26:37Z + + electronics|0.9 memory|0.1 + + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + + USD + One Dollar + Bank of America + boa + currency + Coins and notes + 1,USD + true + + + + EUR + One Euro + European Union + eu + currency + Coins and notes + 1,EUR + true + + + + GBP + One British Pound + U.K. + uk + currency + Coins and notes + 1,GBP + true + + + + NOK + One Krone + Bank of Norway + nor + currency + Coins and notes + 1,NOK + true + + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + 3007WFP + Dell Widescreen UltraSharp 3007WFP + Dell, Inc. + + dell + electronics and computer1 + 30" TFT active matrix LCD, 2560 x 1600, .25mm dot pitch, 700:1 contrast + USB cable + 401.6 + 2199.0 + 6 + true + + 43.17614,-90.57341 + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + VA902B + ViewSonic VA902B - flat panel display - TFT - 19" + ViewSonic Corp. + + viewsonic + electronics and stuff2 + 19" TFT active matrix LCD, 8ms response time, 1280 x 1024 native resolution + 190.4 + 279.95 + 6 + true + + 45.18814,-93.88541 + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + 0579B002 + Canon PIXMA MP500 All-In-One Photo Printer + Canon Inc. + + canon + electronics + multifunction printer + printer + scanner + copier + Multifunction ink-jet color photo printer + Flatbed scanner, optical scan resolution of 1,200 x 2,400 dpi + 2.5" color LCD preview screen + Duplex Copying + Printing speed up to 29ppm black, 19ppm color + Hi-Speed USB + memory card: CompactFlash, Micro Drive, SmartMedia, Memory Stick, Memory Stick Pro, SD Card, and MultiMediaCard + 352.0 + 179.99 + 6 + true + + 45.19214,-93.89941 + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + Welcome to Solr + + +

+ Here is some text +

+

distinct
words

+
Here is some text in a div
+
This has a link.
+ + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + 9885A004 + Canon PowerShot SD500 + Canon Inc. + + canon + electronics + camera + 3x zoop, 7.1 megapixel Digital ELPH + movie clips up to 640x480 @30 fps + 2.0" TFT LCD, 118,000 pixels + built in flash, red-eye reduction + 32MB SD card, USB cable, AV cable, battery + 6.4 + 329.95 + 7 + true + 2006-02-13T15:26:37Z + + 45.19614,-93.90341 + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + SOLR1000 + Solr, the Enterprise Search Server + Apache Software Foundation + software + search + Advanced Full-Text Search Capabilities using Lucene + Optimized for High Volume Web Traffic + Standards Based Open Interfaces - XML and HTTP + Comprehensive HTML Administration Interfaces + Scalability - Efficient Replication to other Solr Search Servers + Flexible and Adaptable with XML configuration and Schema + Good unicode support: héllo (hello with an accent over the e) + 0.0 + 10 + true + 2006-01-17T00:00:00.000Z + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + + + + UTF8TEST + Test with some UTF-8 encoded characters + Apache Software Foundation + software + search + No accents here + This is an e acute: é + eaiou with circumflexes: êâîôû + eaiou with umlauts: ëäïöü + tag with escaped chars: <nicetag/> + escaped ampersand: Bonnie & Clyde + Outside the BMP:𐌈 codepoint=10308, a circle with an x inside. UTF8=f0908c88 UTF16=d800 df08 + 0.0 + true + + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 @@ + + + + + EN7800GTX/2DHTV/256M + ASUS Extreme N7800GTX/2DHTV (256 MB) + + ASUS Computer Inc. + + asus + electronics + graphics card + NVIDIA GeForce 7800 GTX GPU/VPU clocked at 486MHz + 256MB GDDR3 Memory clocked at 1.35GHz + PCI Express x16 + Dual DVI connectors, HDTV out, video input + OpenGL 2.0, DirectX 9.0 + 16.0 + 479.95 + 7 + 40.7143,-74.006 + false + 2006-02-13T15:26:37Z/DAY + + + + 100-435805 + ATI Radeon X1900 XTX 512 MB PCIE Video Card + ATI Technologies + + ati + electronics + graphics card + ATI RADEON X1900 GPU/VPU clocked at 650MHz + 512MB GDDR3 SDRAM clocked at 1.55GHz + PCI Express x16 + dual DVI, HDTV, svideo, composite out + OpenGL 2.0, DirectX 9.0 + 48.0 + 649.99 + 7 + false + 2006-02-13T15:26:37Z/DAY + + 40.7143,-74.006 + + http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/328800ef/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 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/328800ef/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 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/328800ef/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/328800ef/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/328800ef/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/328800ef/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/328800ef/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/328800ef/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/328800ef/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/328800ef/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