Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint 1 #5

Closed
22 tasks done
ribalba opened this issue Sep 18, 2023 · 15 comments
Closed
22 tasks done

Sprint 1 #5

ribalba opened this issue Sep 18, 2023 · 15 comments

Comments

@ribalba
Copy link
Member

ribalba commented Sep 18, 2023

  • Show if data upload and where to
  • Add to settings that upload is a boolean
  • Add defaults if there is no settings file
  • Add section to Readme how to create a settings file
  • Move from joule to wH in frontend. Still save in mJ
  • Make CPU relative to the interval time.
  • Make the titles capital
  • Change "provider App running" to "All measurements systems functional "
  • Add units to table
  • Add table foreground color when in dark mode
  • Add more details to demo data button
  • Add demo Data
  • Nicer welcome screen first time usage
  • Show how big the upload queue is
  • Enable Intel Macs

eMail feedback

Als mir das mit Reminders aufgefallen ist wollte ich gleich einen Mini-Drilldown machen.

Was aktuell für mich optisch nicht möglich ist ist zu verstehen wie große diese Zahl ist die da in der Tabelle steht.

Wenn ich mir Reminders angucke mache ich z.B. oft nach der 5-Minutes Ansicht dann die 24 Stunden Ansicht auf und will gucken wie viel Reminders in den letzten 5 Min im Vergleich zu den letzten 24 Stunden verbraucht hat. Die Zahl ist aber einfach zu unleserlich. 
Das mit der Leserlichkeit hatte ich ja schon mal gesagt, aber mein neuer Wunsch wäre nun nicht nur die Zahl zu formatieren, sondern auch eine Größenordung dranhzuhängen.

Für mich wäre statt 242997621956 => 242.997.621.956 es noch besser wenn man daraus 242.99 Billion machen würde oder falls Billion eine Abkürzung hat auch gerne diese.
Falls du lieber wissenschaftlich machen willst fände ich auch 242.99 10^9 ok
Noch besser, aber tricky weil wir keine Dimension haben,  wäre sowas wie 242.99 GEI (für den Energy impact) und die Zeit in Minuten / Stunden umzurechnen.

Ich weiss nämlich auf Anhieb nicht was 242997621956 in CPU Time ist. Sind das nanosekunden?

3. Was ich auch noch gerne machen würde ist zu gucken ob eine App eine Diskrepanz zwischen Energy Impact und CPU Time. Ich möchte auf den Header der Tabelle klicken und es sortiert sich danach.

Wenn sich dann die Sortierung zwischen Energy Impact und CPU Time ändert, dann ist das eine mögliche Anomalie die ich gerne näher angucken würde.

Nach welcher Spalte ist aktuell sortiert?

Bugs

  • Change type from PATH_PLASE_CHANGE to PATH_PLEASE_CHANGE
  • Check with @arne why install script wasn't run with sudo
  • Check why the Unzip fails @ArneTR
  • Change sed script to be BSD sed
  • Investigate cpu_time
  • Check why settings file is not picked up when not using -d
  • Check why upload fails and kills the program
@ribalba
Copy link
Member Author

ribalba commented Sep 20, 2023

@ArneTR I want to collect all bug reports here for power hog v0.2

@ArneTR
Copy link
Member

ArneTR commented Sep 22, 2023

Bug #1 happened while the Hog.app was already on the system and I was following the install instructions from the welcome screen.

First step failes:

curl -fsSL https://raw.githubusercontent.com/green-coding-berlin/hog/main/install.sh | sudo bash
Xcode Command Line Tools are already installed!
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6100  100  6100    0     0  14721      0 --:--:-- --:--:-- --:--:-- 14987
Archive:  /tmp/latest_release.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/latest_release.zip or
        /tmp/latest_release.zip.zip, and cannot find /tmp/latest_release.zip.ZIP, period.

@ArneTR
Copy link
Member

ArneTR commented Sep 22, 2023

The problem might be that the unzip operation will unzip also to a folder that is only sudo writeable. Somehere there needs to be a sudo call in the file at least

@ArneTR
Copy link
Member

ArneTR commented Sep 22, 2023

Next up I tried to manually go through the install file one by one to install the hog.

I encountered the sed command, which does not work for me. I have the default BSD sed. The following change was necessary:

sed -i "s|PATH_PLASE_CHANGE|/usr/local/bin/hog/|g" /Library/LaunchDaemons/berlin.green-coding.hog.plist
to
sed -i '' "s|PATH_PLASE_CHANGE|/usr/local/bin/hog/|g" /Library/LaunchDaemons/berlin.green-coding.hog.plist

Otherwise I get sed: 1: "/Library/LaunchDaemons/ ...": invalid command code L

@ArneTR
Copy link
Member

ArneTR commented Sep 22, 2023

Mini Note: Maybe change type from PATH_PLASE_CHANGE to PATH_PLEASE_CHANGE

@ArneTR
Copy link
Member

ArneTR commented Sep 22, 2023

The hog is running. First interesting find: energy_impact and avg cpu time can be greatly differing
Screenshot 2023-09-23 at 1 20 42 AM

@ArneTR
Copy link
Member

ArneTR commented Sep 22, 2023

Bug #3: The settings in my settings file in the HOME directory are not picked up. I did not create a settings file in /usr/local/bin/hog

Screenshot 2023-09-23 at 1 23 55 AM Screenshot 2023-09-23 at 1 25 02 AM

In my firewall I see that the requests actually go out wrongly to the live domain

@ArneTR
Copy link
Member

ArneTR commented Sep 22, 2023

Bug #4: I blocked the request to the online domain and the power logger crashed.
Screenshot 2023-09-23 at 1 26 46 AM

Even after 10 Minutes it is not coming back up. The service is still running, but apparently in an endless loop.

Screenshot 2023-09-23 at 1 32 39 AM Screenshot 2023-09-23 at 1 31 43 AM

If I unload the service I can see again data in the Hog macOS panel. However only until the next data upload is tried and blocked.

In order for you to reproduce it I then tried disabling my Wifi. Here the same issue happens, after 5 Minutes and no Internet the hog power logger crashes

@ribalba
Copy link
Member Author

ribalba commented Sep 25, 2023

The problem might be that the unzip operation will unzip also to a folder that is only sudo writeable. Somehere there needs to be a sudo call in the file at least

The installer pipes the script to sudo bash

 curl -fsSL https://raw.githubusercontent.com/green-coding-berlin/hog/main/install.sh | sudo bash

should be the command that is show in the hog? Can you please recheck?

The hog is running. First interesting find: energy_impact and avg cpu time can be greatly differing

It could be that it really depends on what core the process is running. Performance cores take up to 10 times more energy. I am currently looking into the cpu_time as something seems to be off anyway.

@ArneTR
Copy link
Member

ArneTR commented Sep 25, 2023

The problem might be that the unzip operation will unzip also to a folder that is only sudo writeable. Somehere there needs to be a sudo call in the file at least

The installer pipes the script to sudo bash

 curl -fsSL https://raw.githubusercontent.com/green-coding-berlin/hog/main/install.sh | sudo bash

should be the command that is show in the hog? Can you please recheck?

The hog is running. First interesting find: energy_impact and avg cpu time can be greatly differing

It could be that it really depends on what core the process is running. Performance cores take up to 10 times more energy. I am currently looking into the cpu_time as something seems to be off anyway.

You see in my CLI paste here that the pipe is as said to sudo bash. I also retried it just now, error is still current.

To answer your follow up question: In the hog it shows correctly as sudo bash also

@ribalba
Copy link
Member Author

ribalba commented Sep 25, 2023

Can you try:

curl -s https://api.github.com/repos/green-coding-berlin/hog/releases/latest | grep '/hog_power_logger.zip' | cut -d\" -f4

@ArneTR
Copy link
Member

ArneTR commented Sep 25, 2023 via email

@ribalba
Copy link
Member Author

ribalba commented Sep 25, 2023

Hmmm? Why am I getting

# curl -s https://api.github.com/repos/green-coding-berlin/hog/releases/latest | grep '/hog_power_logger.zip' | cut -d\" -f4
https://github.com/green-coding-berlin/hog/releases/download/0.2/hog_power_logger.zip

it seems like the | is not working. But why?

@ribalba
Copy link
Member Author

ribalba commented Sep 28, 2023

For the record:
The settings file was not picked up as @ArneTR put it in his home directory but the power_logger script runs as root. The documentation and implementation were not clear here. Fixed

@ribalba
Copy link
Member Author

ribalba commented Sep 28, 2023

For the record. The curl download was not working as GitHub once in while as an error, that delivers a different version of the json without newlines and the json double.

@ribalba ribalba closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants