beefeeder 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,14 +5,15 @@ const bee_js_1 = require("@ethersphere/bee-js");
5
5
  const cafe_utility_1 = require("cafe-utility");
6
6
  const process_1 = require("process");
7
7
  const GLOBAL_TIMEOUT_MINUTES = 5;
8
+ const beeUrl = cafe_utility_1.Arrays.requireStringArgument(process_1.argv, 'bee-url');
9
+ const batchId = cafe_utility_1.Arrays.requireStringArgument(process_1.argv, 'batch');
10
+ const apiHost = cafe_utility_1.Arrays.requireStringArgument(process_1.argv, 'api-host');
11
+ const observationKey = cafe_utility_1.Arrays.requireStringArgument(process_1.argv, 'observation-key');
8
12
  setTimeout(async () => {
9
13
  console.log(`Script timed out after ${GLOBAL_TIMEOUT_MINUTES} minutes`);
10
- await record('swarm.feed-10.total-millis', -1);
14
+ await record(`swarm.${observationKey}.total-millis`, -1);
11
15
  (0, process_1.exit)(1);
12
16
  }, cafe_utility_1.Dates.minutes(GLOBAL_TIMEOUT_MINUTES));
13
- const beeUrl = cafe_utility_1.Arrays.requireStringArgument(process.argv, 'bee-url');
14
- const batchId = cafe_utility_1.Arrays.requireStringArgument(process.argv, 'batch');
15
- const apiHost = cafe_utility_1.Arrays.requireStringArgument(process.argv, 'api-host');
16
17
  const bee = new bee_js_1.Bee(beeUrl);
17
18
  const privateKey = new bee_js_1.PrivateKey(cafe_utility_1.Strings.randomHex(64));
18
19
  const owner = privateKey.publicKey().address().toHex();
@@ -28,7 +29,7 @@ async function main() {
28
29
  await read(reader, counter);
29
30
  }
30
31
  const totalMillis = Date.now() - startedAt;
31
- await record('swarm.feed-10.total-millis', totalMillis);
32
+ await record(`swarm.${observationKey}.total-millis`, totalMillis);
32
33
  (0, process_1.exit)(0);
33
34
  }
34
35
  async function read(reader, expectedCounter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beefeeder",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "bin": {
5
5
  "beefeeder": "./dist/index.js"
6
6
  },