Welcome to the Metrics Collector API, where we turn your development chaos into beautiful, orderly data. This repository contains the OpenAPI specification for an API that's more excited about collecting metrics than your cat is about knocking things off tables.
Ever wondered how long your builds really take, or if your tests are secretly planning a rebellion? Well, wonder no more! This API specification defines endpoints to collect all sorts of juicy development metrics, from build times to test execution durations. It's like FitBit, but for your code!
- Clone this repo (you know the drill)
- Pick your favorite code generator
- Generate some server-side code
- Implement your data storage
- Deploy your API
There are more code generators out there than flavors of La Croix. Here are a few popular ones:
- OpenAPI Generator (the Swiss Army knife of generators)
- Swagger Codegen (old but gold)
- NSwag (for when you're feeling fancy)
We'll use OpenAPI Generator in our examples because we're basic like that.
Time to make your computer earn its keep:
-
Install OpenAPI Generator (follow their instructions, we believe in you)
-
Run the generator. For example, to generate a Spring Boot server:
openapi-generator generate -i openapi.yaml -g spring -o ./generated-server
Replace
spring
with your language of choice. Go wild! (But stick to the supported ones, we're not magicians.) -
Marvel at the generated code in
./generated-server
. It's not Shakespeare, but it'll do.
Now for the fun part: making those generated interfaces actually do something! Here's a taste of what you're in for:
@Service
public class DotnetServiceImpl implements DotnetApiDelegate {
@Autowired
private YourDataStorageService dataStorage;
@Override
public ResponseEntity<Void> dotnetCollectData(DotnetMsBuild dotnetMsBuild) {
// Your logic here. Try not to cry.
dataStorage.storeBuildMetrics(dotnetMsBuild);
return ResponseEntity.ok().build();
}
}
Choose your deployment method. Docker? Serverless? Carrier pigeon? The world is your oyster. (Note: carrier pigeon method not recommended for high-traffic APIs.)
Found a bug? Have an idea? We're all ears! Submit a pull request and join the "I improved an open-source project" club. Membership cards pending.
This project is licensed under the Apache 2.0 license - see the LICENSE file for details. It's very riveting reading, we promise.
Remember, with great metrics comes great responsibility. Happy collecting!