This file contains hidden or 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
| package gocontext | |
| import ( | |
| "context" | |
| "net/http" | |
| ) | |
| type SomeMiddleware interface { | |
| HandleHTTPC(ctx context.Context, rw http.ResponseWriter, req *http.Request, next http.Handler) | |
| } |
This file contains hidden or 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
| package main | |
| import "fmt" | |
| import "golang.org/x/net/context" | |
| // A message processes parameter and returns the result on resChan. | |
| // ctx is places in a struct, but this is ok to do. | |
| type message struct { | |
| resChan chan<- int | |
| parameter string |
This file contains hidden or 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
| package main | |
| import ( | |
| "errors" | |
| "fmt" | |
| "testing" | |
| "github.com/stretchr/testify/require" | |
| ) |
This file contains hidden or 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
| package main | |
| import ( | |
| "errors" | |
| "fmt" | |
| "testing" | |
| "github.com/stretchr/testify/require" | |
| ) |
This file contains hidden or 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
| package main | |
| import ( | |
| "errors" | |
| "fmt" | |
| "testing" | |
| "github.com/stretchr/testify/require" | |
| ) |
This file contains hidden or 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
| package main | |
| import ( | |
| "errors" | |
| "fmt" | |
| "testing" | |
| "github.com/stretchr/testify/require" | |
| ) |
This file contains hidden or 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
| Feature | gRPC | REST | |
|---|---|---|---|
| Contract | Required (*.proto) | Optional (OpenAPI) | |
| Transport | HTTP/2 | HTTP | |
| Payload | Protobuf (small and binary) | JSON (large and human readable) | |
| Prescriptiveness | Strict specification | Loose. Any HTTP is valid | |
| Streaming | Client/Server/Bi-Directional | Client/Server | |
| Broswer support | No (requires grpc-web) | Yes | |
| Security | Transport (HTTPS) | Transport (HTTPS) | |
| Client code-gen | Yes | OpenAPI + third0party tooling |
This file contains hidden or 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
| { | |
| "config": { | |
| "phases": [ | |
| { | |
| "duration": 120, | |
| "arrivalRate": 10, | |
| "rampTo": 20, | |
| "name": "Warm up the ALB/ECS service" | |
| }, | |
| { |
This file contains hidden or 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
| const maxMetricName = `limits.salesforce.${limit}.Max`; | |
| const reminingMatricName = `limits.salesforce.${limit}.Remaining`; | |
| const { Max, Remaining } = limits[limit]; | |
| console.log(`MONITORING|${unix_epoch_timestamp}|${Max}|${metric_type}|${maxMetricName}|#${tags}`); | |
| console.log(`MONITORING|${unix_epoch_timestamp}|${Remaining}|${metric_type}|${remainingMetricName}|#${tags}`); |
This file contains hidden or 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
| ['Max', 'Remaining'].forEach(metric => { | |
| const metricName = `limits.salesforce.${limit}.${metric}`; | |
| const value = limits[limit][metric]; | |
| console.log( | |
| `MONITORING|${unixEpochTimestamp}|${value}|${metricType}|${metricName}|#${tagsTrackBeta}` | |
| ); | |
| }); |
NewerOlder