![]() ![]() So metrics are also available per package and core. I found that the IPG framework returns the number of packages (processors) available in the system and then you use the further methods to fetch the metrics using package number. While trying to figure out how to present the available data. So I would need a structure for Frequency/Temperature with mean/min/max values.Īn interesting point I discovered while looking into the IDP header is that processor power values are returning in Watts and Joule's values.Īnother interesting point about go structures I found is that you can define a JSON field name just by using an annotation style format. Metric from between two samples which provides mean, min, max values.The IDP framework provides few ways to get metrics about the processor: Now that we have basic unit types available we can look further in data structures. One of the features I learned and really liked was that you can alias other types. I started defining structures I will be providing with this module. After looking into go documentation about how to do C bindings I found it was pretty easy and convenient compared to other languages.Īfter spending time researching the available metrics, value and other data fields. Now that we have found the framework and header file we can begin writing actual Go code. After careful looking, I decided to pick the PowerGadgetLib.h header file as it had almost all required metrics available. I found it at /Library/Frameworks folder and headers were in /Library/Frameworks/amework/Headers path.Īfter looking into the headers folder I have found 3 interfaces available. After looking at typical macOS framework location. The next step is to figure the IPG framework and it's header's location. ![]() Now that all dependencies are downloaded and installed we can start making a go module as I would like to have this as a module so it could be reused later on in different projects. There are a few preparation steps before I can dive into the code. Create a C utility application that would spit out JSON/CSV data into some log file and configure those metrics to consume it.Īfter careful thinking, I decided maybe it's time to learn Golang as it is a moderately mature language compared to back when I was just touching Golang.Create a plugin for the collector tool (Write it in Golang).I am a complete beginner with Golang and never have properly used it apart editing a few things in existing projects in my previous companies. ![]() Quick looking at the services I will be using for storing metrics in my case Elasticsearch ( Metricbeats), InfluxDB ( Telegraf) both metric collector tools Metricbeats and Telegraf are written in Golang. Now that I know that I can collect the metrics from the Intel Power Gadget framework, now I have to decide with which programming language I should try to integrate. I was racking my brains how I could utilize this application to collect the data from it when I have found that there are a framework and headers available for integrating this library in your application. These metrics are really well provided by the Intel Power Gadget application. The most important metrics for me in this machine are Intel processor utilization, frequency, and temperature metrics. The biggest problem for me is the Hackintosh system as it is running macOS and there are not many open source solutions for my problem or those are incompatible because I am running the Hackintosh version of macOS with custom hardware.
0 Comments
Leave a Reply. |