-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin and sample app are both working
- Loading branch information
Showing
13 changed files
with
16,399 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const { defaultConfig } = require('judoscale-node-core') | ||
|
||
class Adapter { | ||
constructor(collectors) { | ||
this.collectors = collectors | ||
this.identifier = 'judoscale-fastify' | ||
this.adapter_version = defaultConfig.version | ||
this.language_version = process.version | ||
} | ||
|
||
asJson() { | ||
const data = {} | ||
data[this.identifier] = { | ||
adapter_version: this.adapter_version, | ||
language_version: this.language_version, | ||
} | ||
|
||
return data | ||
} | ||
} | ||
|
||
module.exports = Adapter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Judoscale Demo (Fastify) | ||
|
||
A tiny Fastify app for testing Judoscale. | ||
|
||
## Local Run | ||
|
||
Ensure the Heroku CLI is installed. | ||
|
||
```shell | ||
heroku -v | ||
``` | ||
|
||
Install dependencies. Note that we're using `yarn` instead of `npm` so we can use "resolutions". More on this below. | ||
|
||
```shell | ||
npm install | ||
``` | ||
|
||
Run the app: | ||
|
||
```shell | ||
bin/dev | ||
``` | ||
|
||
This will run both the app and a proxy server that adds the X-Request-Start header for simulating request queue time. | ||
|
||
http://localhost:5004 | ||
|
||
## Local development | ||
|
||
To reference the local version of `judoscale-fastify` instead of the NPM version: | ||
|
||
``` | ||
npm link judoscale-fastify | ||
``` | ||
|
||
This will create a symlink for `node_modules/judoscale-fastify` pointing to the local file system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.