Julia client for Smelt.jl
Smelt helps software development teams monitor their sensitive resources. These resources can include runtime, memory, api usage, function calls, and the like.
Smelt provides a simple API:
name
: The name of your metricvalue
: The value of the metric- (Optional)
write
: Defaults tofalse
, determines if data is saved permanently to Smelt - (Optional)
date
: The date of the metric (defaults to now)
function performance_function()
# Lots of code, we want to know when performance changes. And we want history of performance
end
function test_performance_function()
start_time = now()
performance_function()
end_time = now()
result = Smelt.send("Performance function runtime", end_time - start_time)
if result.isabnormal
fail("Smelt detected an abnormality! See $(result.link) for details")
end
end
function call_expensive_api() end
end
function do_complex_workflow()
...
# Lots of code that calls `call_expensive_api` some number of times, which we'd like to track
end
We're going to mock call_expensive_api
and count the number of times it is called, and log to Smelt
function test_expensive_api_usage_in_complex_workflow()
api_mock = mock(call_expensive_api)
do_complex_workflow()
result = Smelt.send("Expensive API Calls From Complex Workflow", api_mock.call_count)
if result.isabnormal
fail("Smelt detected an abnormality! See $(result.link) for details.")
end
end
Things to consider
- Data shouldn't always get saved, for example running locally or from a PR.
- Could make it aware of the hardware it's running on.
Steps a user needs to take:
- Register account and get API key
- Include open-source client library to project
- Write tests
- Intelligently confiure when data should get written permanently to Smelt. It should only
write
when it's the master branch running on the build server. - Visit the Smelt web app and configure anomaly thresholds