Skip to content

Commit 09d7384

Browse files
authored
Merge pull request #16 from floornfts/cfky/remove-hot-shots
Remove hot shots
2 parents 02e516b + a476732 commit 09d7384

6 files changed

Lines changed: 3 additions & 75 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
"eslint": "^8.11.0",
8787
"eslint-plugin-import": "^2.25.4",
8888
"eslint-plugin-unused-imports": "^2.0.0",
89-
"hot-shots": "^9.1.0",
9089
"husky": "^7.0.0",
9190
"jest": "^27.5.1",
9291
"lint-staged": "^12.3.7",

src/api/alchemy-config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { StatsD } from 'hot-shots';
2-
31
import { ConnectionInfo } from '@ethersproject/web';
42

53
import { AlchemySettings, Network } from '../types/types';
@@ -52,11 +50,6 @@ export class AlchemyConfig {
5250
*/
5351
readonly requestTimeout?: number;
5452

55-
/**
56-
* Optional StatsD client to use for tracking metrics.
57-
*/
58-
readonly statsD: StatsD | undefined;
59-
6053
/**
6154
* Dynamically imported provider instance.
6255
*
@@ -82,7 +75,6 @@ export class AlchemyConfig {
8275
this.batchRequests = config?.batchRequests || false;
8376
this.requestTimeout = config?.requestTimeout || DEFAULT_REQUEST_TIMEOUT;
8477
this.connectionInfoOverrides = config?.connectionInfoOverrides;
85-
this.statsD = config?.statsD;
8678
}
8779

8880
/**

src/internal/dispatch.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ export async function requestHttpWithBackoff<Req, Res>(
4444
{
4545
...overrides,
4646
timeout: config.requestTimeout
47-
},
48-
config.statsD
47+
}
4948
);
5049

5150
if (response.status === 200) {

src/types/types.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { StatsD } from 'hot-shots';
2-
31
import {
42
BlockTag,
53
EventType,
@@ -91,11 +89,6 @@ export interface AlchemySettings {
9189
* {@link https://docs.ethers.org/v5/api/utils/web/#ConnectionInfo}
9290
*/
9391
connectionInfoOverrides?: Partial<ConnectionInfo>;
94-
95-
/**
96-
* Optional StatsD client to use for tracking metrics.
97-
*/
98-
statsD?: StatsD;
9992
}
10093

10194
/**

src/util/sendRest.ts

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* returns the response.
44
*/
55
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
6-
import { StatsD } from 'hot-shots';
76

87
import { VERSION } from '../version';
98
import { IS_BROWSER } from './util';
@@ -18,8 +17,7 @@ export function sendAxiosRequest<Req, Res>(
1817
restApiName: string,
1918
methodName: string,
2019
params: Req,
21-
overrides?: AxiosRequestConfig,
22-
statsD?: StatsD
20+
overrides?: AxiosRequestConfig
2321
): Promise<AxiosResponse<Res>> {
2422
const requestUrl = baseUrl + '/' + restApiName;
2523
const config: AxiosRequestConfig = {
@@ -34,26 +32,5 @@ export function sendAxiosRequest<Req, Res>(
3432
url: requestUrl,
3533
params
3634
};
37-
return axios(config)
38-
.then(response => {
39-
if (statsD) {
40-
// Track success with status code
41-
statsD.increment(
42-
`alchemy-sdk.${methodName}.success.${response.status}`
43-
);
44-
// Track overall success
45-
statsD.increment(`alchemy-sdk.${methodName}.success`);
46-
}
47-
return response;
48-
})
49-
.catch(error => {
50-
if (statsD) {
51-
// Track error with status code if available
52-
const statusCode = error.response?.status || 'unknown';
53-
statsD.increment(`alchemy-sdk.${methodName}.error.${statusCode}`);
54-
// Track overall error
55-
statsD.increment(`alchemy-sdk.${methodName}.error`);
56-
}
57-
throw error;
58-
});
35+
return axios(config);
5936
}

yarn.lock

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,13 +1825,6 @@ binary-searching@^2.0.5:
18251825
resolved "https://registry.npmjs.org/binary-searching/-/binary-searching-2.0.5.tgz"
18261826
integrity sha512-v4N2l3RxL+m4zDxyxz3Ne2aTmiPn8ZUpKFpdPtO+ItW1NcTCXA7JeHG5GMBSvoKSkQZ9ycS+EouDVxYB9ufKWA==
18271827

1828-
bindings@^1.5.0:
1829-
version "1.5.0"
1830-
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
1831-
integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
1832-
dependencies:
1833-
file-uri-to-path "1.0.0"
1834-
18351828
bl@^4.0.3:
18361829
version "4.1.0"
18371830
resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
@@ -2854,11 +2847,6 @@ file-entry-cache@^6.0.1:
28542847
dependencies:
28552848
flat-cache "^3.0.4"
28562849

2857-
file-uri-to-path@1.0.0:
2858-
version "1.0.0"
2859-
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
2860-
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
2861-
28622850
fill-range@^7.0.1:
28632851
version "7.0.1"
28642852
resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz"
@@ -3152,13 +3140,6 @@ hmac-drbg@^1.0.1:
31523140
minimalistic-assert "^1.0.0"
31533141
minimalistic-crypto-utils "^1.0.1"
31543142

3155-
hot-shots@^9.1.0:
3156-
version "9.3.0"
3157-
resolved "https://registry.yarnpkg.com/hot-shots/-/hot-shots-9.3.0.tgz#1a0b54b81d9efb27af96a971befe343908b0397b"
3158-
integrity sha512-e4tgWptiBvlIMnAX0ORe+dNEt0HznD+T2ckzXDUwCBsU7uWr2mwq5UtoT+Df5r9hD5S/DuP8rTxJUQvqAFSFKA==
3159-
optionalDependencies:
3160-
unix-dgram "2.x"
3161-
31623143
html-encoding-sniffer@^2.0.1:
31633144
version "2.0.1"
31643145
resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz"
@@ -4521,11 +4502,6 @@ ms@^2.0.0, ms@^2.1.1:
45214502
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
45224503
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
45234504

4524-
nan@^2.16.0:
4525-
version "2.22.2"
4526-
resolved "https://registry.yarnpkg.com/nan/-/nan-2.22.2.tgz#6b504fd029fb8f38c0990e52ad5c26772fdacfbb"
4527-
integrity sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ==
4528-
45294505
nanoid@^3.2.0, nanoid@^3.3.2:
45304506
version "3.3.2"
45314507
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz"
@@ -5710,14 +5686,6 @@ universalify@^2.0.0:
57105686
resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz"
57115687
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==
57125688

5713-
unix-dgram@2.x:
5714-
version "2.0.6"
5715-
resolved "https://registry.yarnpkg.com/unix-dgram/-/unix-dgram-2.0.6.tgz#6d567b0eb6d7a9504e561532b598a46e34c5968b"
5716-
integrity sha512-AURroAsb73BZ6CdAyMrTk/hYKNj3DuYYEuOaB8bYMOHGKupRNScw90Q5C71tWJc3uE7dIeXRyuwN0xLLq3vDTg==
5717-
dependencies:
5718-
bindings "^1.5.0"
5719-
nan "^2.16.0"
5720-
57215689
upath2@^3.1.12:
57225690
version "3.1.12"
57235691
resolved "https://registry.npmjs.org/upath2/-/upath2-3.1.12.tgz"

0 commit comments

Comments
 (0)