From 9155d39d1a202e90ce6f041afb85ca07de629143 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Thu, 4 Aug 2022 13:23:44 -0700 Subject: [PATCH] chore: delete benchwarpper code Project never made it out of prototype phase and we are moving away from this testing method in general. If we do come back to it; this code will still be too old / unmaintained. --- bin/README.md | 13 --------- bin/benchwrapper.js | 70 --------------------------------------------- bin/storage.proto | 45 ----------------------------- 3 files changed, 128 deletions(-) delete mode 100644 bin/README.md delete mode 100755 bin/benchwrapper.js delete mode 100644 bin/storage.proto diff --git a/bin/README.md b/bin/README.md deleted file mode 100644 index ad02e54ed..000000000 --- a/bin/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# benchwrapper - -benchwrapper is a lightweight gRPC server that wraps the storage library for -benchmarking purposes. - -## Running - -``` -cd nodejs-storage -npm install -export STORAGE_EMULATOR_HOST=localhost:8080 -npm run benchwrapper -- --port 8081 -``` diff --git a/bin/benchwrapper.js b/bin/benchwrapper.js deleted file mode 100755 index 2e8746d6e..000000000 --- a/bin/benchwrapper.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 Google LLC -// -// 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. - -const grpc = require('@grpc/grpc-js'); -const protoLoader = require('@grpc/proto-loader'); -const {Storage} = require('../build/src'); - -const argv = require('yargs') - .option('port', { - description: 'The port that the Node.js benchwrapper should run on.', - type: 'number', - demand: true, - }) - .parse(); - -const PROTO_PATH = __dirname + '/storage.proto'; -// Suggested options for similarity to existing grpc.load behavior. -const packageDefinition = protoLoader.loadSync(PROTO_PATH, { - keepCase: true, - longs: String, - enums: String, - defaults: true, - oneofs: true, -}); -const protoDescriptor = grpc.loadPackageDefinition(packageDefinition); -const storageBenchWrapper = protoDescriptor.storage_bench; - -const storageClient = new Storage(); - -function read(call, callback) { - const bucketName = call.request.bucketName; - const objectName = call.request.objectName; - - storageClient - .bucket(bucketName) - .file(objectName) - .download({validation: false}) - .then(() => callback(null, null)); -} - -function write(call, callback) { - // TODO(deklerk) - callback(null, null); -} - -const server = new grpc.Server(); - -server.addService(storageBenchWrapper['StorageBenchWrapper']['service'], { - read: read, - write: write, -}); -console.log('starting on localhost:' + argv.port); -server.bindAsync( - '0.0.0.0:' + argv.port, - grpc.ServerCredentials.createInsecure(), - () => { - server.start(); - } -); diff --git a/bin/storage.proto b/bin/storage.proto deleted file mode 100644 index 31779c5ce..000000000 --- a/bin/storage.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2016 Google LLC -// -// 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 applicwable 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. - -syntax = "proto3"; - -package storage_bench; -option java_multiple_files = true; -option java_package = "com.benchwrapper"; - -message ObjectRead{ - // The bucket string identifier. - string bucketName = 1; - // The object/blob string identifier. - string objectName = 2; -} - -message ObjectWrite{ - // The bucket string identifier. - string bucketName = 1; - // The object/blob string identifiers. - string objectName = 2; - // The string containing the upload file path. - string destination = 3; -} - -message EmptyResponse{ -} - -service StorageBenchWrapper{ - // Performs an upload from a specific object. - rpc Write(ObjectWrite) returns (EmptyResponse) {} - // Read a specific object. - rpc Read(ObjectRead) returns (EmptyResponse){} -} \ No newline at end of file