Welcome!

Blog Feed Post

Building a hamster fitness tracker using Dynatrace API

Hamsters are nocturnal rodents and, therefore, are mostly active during the night. My boyfriend and I do have a hamster, and curiosity led us to start thinking about how we could track some of his activities, specifically how far he is able to run within a night. So we decided to turn the hamster wheel into a fitness tracker using the Dynatrace API. Basically, we wanted to capture all the rotations of it. And, there was not much additional “hardware” needed for this goal to be achieved.

We already had the hamster…

…and the hamster wheel.

Required hardware:

  • Hamster
  • Hamster wheel – with a large enough diameter eg “Silent Runner” ~30cm
  • Microcontroller with an integrated wifi chip (ESP8266) – eg a NodeMCU
  • Infrared obstacle avoidance sensor – eg KY-032
  • Small reflector stripe (eg aluminum foil)

Software setup:

  • MQTT broker – eg Mosquitto
  • Node-Red
  • Dynatrace SaaS

Modifying the hamster wheel

It was mandatory that we do not install any wires inside the terrarium. All wires had to be installed on the outside only, out of the hamster’s reach. We decided to use an infrared obstacle avoidance sensor — sensitive to light reflections — which could be placed on top of the terrarium. Next we applied an aluminum foil reflector stripe to the wheel.

 

Implementing the fitness tracker

The simplest way for us to process the sensor’s data was using a micro controller with an integrated wifi-chip. As a start we wanted to capture some metrics per rotation and some lap and night summary statistics like speed and distance. For all of these metrics we registered a custom time series identifier via the Dynatrace API and, additionally, the hamster wheel was registered as a custom device.

The microcontroller was programmed to calculate and send all the needed metrics to an MQTT broker used as a sort of relay station. MQTT is an extremely lightweight messaging protocol for devices with limited processing power and/or network bandwidth – thus, a perfect fit for us. As the Dynatrace API expects the metrics in JSON format we needed to add some conversion of the sensor’s raw data. This could easily be achieved by implementing a Node-RED flow.

Our flow subscribes to the MQTT broker filtering the incoming wheel’s sensor data. The data is then enriched with the current time stamp and converted to a JSON payload which is sent via HTTP to the Dynatrace REST API.

Fitness Results

I created a custom dashboard showing all the different hamster wheel’s metrics.

It turned out that our hamster is very busy every night. Usually he runs about 5 to 7 kilometers with an average speed of 3 kilometers per hour. So far his personal record was a total distance of roughly 8.5 kilometers per night which equal to approximately 8,900 rotations. He always runs several laps — mostly about 50 to 150 — whereby a lap’s distance adds up to 0.1 to 0.9 kilometers.

Here are the charts showing our hamster’s current “high scores”:

The night run’s total distance…

The total distance of a night’s run — constantly increasing to a total of ~8.5 km within a time of roughly 4 hours.

…and total number of rotations.

The total number of rotations for a night’s run — constantly increasing to a total of ~9,000 rotations within a time of roughly 4 hours

As well as the average distances per lap…

A night’s run always consists of several laps, whereby a single one usually adds up to 0.1 to 0.9 kilometers.

And, of course, speed!

Typically, the average speed is around 3 kilometers per hour — sometimes also a bit higher.

Conclusion

We learned that the reason our hamster sleeps so much during the day is because he is exhausted from his nighttime workouts! 8.5 kilometers — or a little more than 5 miles — is a significant run for a human! But for such a tiny creature which such short legs, 5 miles is a major accomplishment. We can’t wait to see if he takes a recovery day (or night) like most runners do! In the meantime his terrarium will continue to be located in another room far from the bedroom!

He also gets an incredible amount of mileage for the relatively small amount of fuel he consumes. He’s a very efficient little creature!

However, the primary reason I embarked on this project is to demonstrate, in a humorous way, the versatility of our APM solution for nearly any application you can imagine — large, small, or somewhere in between.

Also, I wanted to show you, the reader, a little bit of the Dynatrace culture and how our commitment to providing the best possible APM solution extends well beyond our workday. I hope you found this posting to be entertaining and informative.

The post Building a hamster fitness tracker using Dynatrace API appeared first on Dynatrace blog – monitoring redefined.

Read the original blog entry...

More Stories By Dynatrace Blog

Building a revolutionary approach to software performance monitoring takes an extraordinary team. With decades of combined experience and an impressive history of disruptive innovation, that’s exactly what we ruxit has.

Get to know ruxit, and get to know the future of data analytics.

Latest Stories
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
The 21st International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Digital Transformation, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists will look at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deli...
While some vendors scramble to create and sell you a fancy solution for monitoring your spanking new Amazon Lambdas, hear how you can do it on the cheap using just built-in Java APIs yourself. By exploiting a little-known fact that Lambdas aren’t exactly single threaded, you can effectively identify hot spots in your serverless code. In his session at 20th Cloud Expo, David Martin, Principal Product Owner at CA Technologies, will give a live demonstration and code walkthrough, showing how to ov...
SYS-CON Events announced today that Systena America will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Systena Group has been in business for various software development and verification in Japan, US, ASEAN, and China by utilizing the knowledge we gained from all types of device development for various industries including smartphones (Android/iOS), wireless communication, security technology and IoT serv...
SYS-CON Events announced today that Loom Systems will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend @CloudExpo | @ThingsExpo, June 6-8, 2017, at the Javits Center in New York City, NY and October 31 - November 2, 2017, Santa Clara Convention Center, CA. Learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
SYS-CON Events announced today that EARP Integration will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. EARP Integration is a passionate software house. Since its inception in 2009 the company successfully delivers smart solutions for cities and factories that start their digital transformation. EARP provides bespoke solutions like, for example, advanced enterprise portals, business intelligence systems an...
We build IoT infrastructure products - when you have to integrate different devices, different systems and cloud you have to build an application to do that but we eliminate the need to build an application. Our products can integrate any device, any system, any cloud regardless of protocol," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA
SYS-CON Events announced today that Enzu will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive ad...
Existing Big Data solutions are mainly focused on the discovery and analysis of data. The solutions are scalable and highly available but tedious when swapping in and swapping out occurs in disarray and thrashing takes place. The resolution for thrashing through machine learning algorithms and support nomenclature is through simple techniques. Organizations that have been collecting large customer data are increasingly seeing the need to use the data for swapping in and out and thrashing occurs ...
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
SYS-CON Events announced today that Interoute has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Interoute is the owner operator of Europe's largest network and a global cloud services platform, which encompasses over 70,000 km of lit fiber, 15 data centers, 17 virtual data centers and 33 colocation centers, with connections to 195 additional partner data centers. Our full-service Unifie...
SYS-CON Events announced today that delaPlex will exhibit at SYS-CON's @CloudExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. delaPlex pioneered Software Development as a Service (SDaaS), which provides scalable resources to build, test, and deploy software. It’s a fast and more reliable way to develop a new product or expand your in-house team.
SYS-CON Events announced today that Progress, a global leader in application development, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Enterprises today are rapidly adopting the cloud, while continuing to retain business-critical/sensitive data inside the firewall. This is creating two separate data silos – one inside the firewall and the other outside the firewall. Cloud ISVs oft...