Skip to content

Commit e176dd5

Browse files
committed
One log line per scope GET request
1 parent 9dfb7ab commit e176dd5

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

bin/scope.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,18 @@ export async function scope(filePath) {
7474
}
7575

7676
// Handle the request and send a response
77-
console.log('Request ', request.request_id, request.type, request.key)
7877
try {
7978
const response = await handleRequest(request, workingDir)
8079
ws.send(JSON.stringify(response))
81-
console.log('Response', request.request_id, response.status, response.headers['Content-Length'])
80+
// Log GET requests: "GET 206 file.parquet (bytes 0-99)" or "GET 200 file.parquet (1234)"
81+
if (request.type === 'get') {
82+
const fileName = request.key.split('/').pop() || request.key
83+
const range = response.headers['Content-Range']
84+
const size = range
85+
? `bytes ${range.replace(/^bytes /, '').replace(/\/.*$/, '')}`
86+
: response.headers['Content-Length']
87+
console.log(`GET ${response.status} ${fileName} (${size})`)
88+
}
8289
} catch (err) {
8390
console.error('Hyperscope error handling request:', err)
8491
// Send error response

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
},
5858
"dependencies": {
5959
"@aws-sdk/client-s3": "3.1029.0",
60-
"@aws-sdk/credential-provider-node": "3.927.0",
60+
"@aws-sdk/credential-provider-node": "3.972.30",
6161
"hightable": "0.26.4",
6262
"hyparquet": "1.25.6",
6363
"hyparquet-compressors": "1.1.1",
6464
"icebird": "0.3.1",
65-
"squirreling": "0.12.2",
65+
"squirreling": "0.12.3",
6666
"ws": "8.20.0"
6767
},
6868
"devDependencies": {
@@ -79,7 +79,7 @@
7979
"eslint-plugin-react-hooks": "7.0.1",
8080
"eslint-plugin-react-refresh": "0.5.2",
8181
"eslint-plugin-storybook": "10.3.5",
82-
"globals": "17.4.0",
82+
"globals": "17.5.0",
8383
"jsdom": "29.0.2",
8484
"nodemon": "3.1.14",
8585
"npm-run-all": "4.1.5",

0 commit comments

Comments
 (0)