Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

WIP New devices stats report #316

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

DIOHz0r
Copy link
Contributor

@DIOHz0r DIOHz0r commented Feb 8, 2018

Changes description

Add a new graph to show the last contacted date and time for agents

Checklist

Please check if your PR fulfills the following specifications:

  • Tests for the changes have been added
  • Docs have been added/updated

References

Closes flyve-mdm/glpi-plugin#34

@DIOHz0r DIOHz0r requested a review from btry February 8, 2018 17:48
accesslint[bot]
accesslint bot previously approved these changes Feb 8, 2018
Copy link
Contributor

@btry btry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the quiery as I recommended.

In the mean time I'll check how it looks (and add a screenshot if nice to show)

$domain = $range = $serie = [];
$FlyvemdmAgent = PluginFlyvemdmAgent::getTable();
$logTable = Log::getTable();
$query = "SELECT l.`new_value` AS online_date, f.`name` AS agent_name, f.`id` AS agent_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you introduce queries un the plugin, use the query builder. RAW SQL queries is deprecated.

http://glpi-developer-documentation.readthedocs.io/en/master/devapi/database/index.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done it on new commit

@DIOHz0r DIOHz0r changed the title New devices stats report WIP New devices stats report Feb 8, 2018
@btry
Copy link
Contributor

btry commented Feb 9, 2018

@DIOHz0r

if we have hundreds or thousands of agents, I think the graph will be unreadable. I think it would be more interesting to count the number of devices online per hour of a day for example. But again, this would be useful only for the current day, or the few last ones.

Moreover the current query tracks the is_online changes, not their status at some point of the timeline.

As is, I'm not convinced the admin will get useful information from this graph. I think it would be more interesting to get the online ratio per hour for the last few days (week for example ?)

Also the logs table may be deleted by a plugin for GLPI X days we have a limited ability to look in the past.

@btry
Copy link
Contributor

btry commented Feb 9, 2018

Also you should filter by search option 11, not 8. 11 is the flag is_online, and it is t imestamped in the logs.

@DIOHz0r
Copy link
Contributor Author

DIOHz0r commented Feb 9, 2018

I'm conscious about having a lot of data on the report. The query is incomplete and the idea is show only a range of days maybe 5 days by default. Let's try first to show the data and then create the default range of info to show

@btry
Copy link
Contributor

btry commented Feb 9, 2018

What about the other points I talked about. Do you plan to show every agent ? Do you plan to show dots for is_online changes ?

ajsb85
ajsb85 previously approved these changes May 15, 2018
@ajsb85 ajsb85 requested a review from Naylin15 May 22, 2018 10:34
@ajsb85 ajsb85 added this to the 2.1 milestone May 22, 2018
@DIOHz0r DIOHz0r dismissed stale reviews from ajsb85 and accesslint[bot] via 9b5fc34 July 4, 2018 13:48
@ajsb85 ajsb85 self-requested a review September 21, 2018 09:16
@ajsb85 ajsb85 closed this Dec 18, 2018
@ajsb85 ajsb85 reopened this Dec 18, 2018
@ajsb85 ajsb85 changed the base branch from develop to features/for_later December 18, 2018 00:27
@btry btry closed this Dec 20, 2018
@btry btry changed the base branch from features/for_later to develop December 20, 2018 17:46
@btry btry reopened this Dec 20, 2018
@ajsb85 ajsb85 assigned DIOHz0r and unassigned DIOHz0r Dec 21, 2018
@ajsb85 ajsb85 modified the milestones: 2.1, 3.0 Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintain history of online status
3 participants