This repository was archived by the owner on Sep 28, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +33
-5
lines changed Expand file tree Collapse file tree 4 files changed +33
-5
lines changed Original file line number Diff line number Diff line change 1+ // Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ // SPDX-License-Identifier: MIT-0
3+ const elasticsearch = require ( 'elasticsearch' ) ;
4+ const awsElasticSearch = require ( 'http-aws-es' ) ;
5+ const ChanceJs = require ( 'chance' ) ;
6+ const chance = new ChanceJs ( ) ;
7+
8+ describe ( 'Elasticsearch Document Consumer' , ( ) => {
9+
10+ const elasticSearchUrl = 'https://banana.us-west-2.es.amazonaws.com' ;
11+ const index = 'performance-testing' ;
12+ const client = new elasticsearch . Client ( {
13+ hosts : [ elasticSearchUrl ] ,
14+ connectionClass : awsElasticSearch ,
15+ apiVersion : "6.3" ,
16+ } ) ;
17+
18+ it ( 'searches documents based on random text' , ( ) => {
19+ return client . search ( {
20+ index : index ,
21+ q : chance . word ( ) ,
22+ } ) ;
23+ } ) ;
24+ } ) ;
Original file line number Diff line number Diff line change 22 "name" : " elasticsearch-test-suite" ,
33 "version" : " 1.0.0" ,
44 "description" : " Example of load testing an Amazon Elasticsearch cluster" ,
5- "main" : " index .test.js" ,
5+ "main" : " producer .test.js" ,
66 "dependencies" : {
77 "aws-sdk" : " ^2.348.0" ,
88 "chance" : " ^1.0.16" ,
1212 },
1313 "devDependencies" : {},
1414 "scripts" : {
15- "test" : " mocha index .test.js"
15+ "test" : " mocha producer .test.js"
1616 },
1717 "author" : " Fernando Dingler" ,
1818 "license" : " MIT-0" ,
Original file line number Diff line number Diff line change 1- // Copyright <YEAR> Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+ // Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22// SPDX-License-Identifier: MIT-0
33const elasticsearch = require ( 'elasticsearch' ) ;
44const awsElasticSearch = require ( 'http-aws-es' ) ;
55const ChanceJs = require ( 'chance' ) ;
66const chance = new ChanceJs ( ) ;
77
8- describe ( 'Elasticsearch GameDay ' , ( ) => {
8+ describe ( 'Elasticsearch Document Producer ' , ( ) => {
99
1010 const elasticSearchUrl = 'https://banana.us-west-2.es.amazonaws.com' ;
1111 const index = 'performance-testing' ;
Original file line number Diff line number Diff line change @@ -16,7 +16,11 @@ execution:
1616- executor : mocha
1717 hold-for : 1m
1818 scenario :
19- script : index.test.js
19+ script : producer.test.js
20+ - executor : mocha
21+ hold-for : 1m
22+ scenario :
23+ script : consumer.test.js
2024
2125services :
2226- module : shellexec
You can’t perform that action at this time.
0 commit comments