Repository navigation
Conversation
| '/front/dashboard_assets.php', | ||
| '/front/dashboard_helpdesk.php', | ||
| '/front/ticket.php', | ||
| '/front/helpdesk.public.php', |
There was a problem hiding this comment.
On 11.0 this URL redirects to /Helpdesk, whose dashboard tab can show carbon cards, so match the route instead:
| '/front/helpdesk.public.php', | |
| '/Helpdesk', |
| } | ||
| } | ||
|
|
||
| public function testEvaluateItemTwiceWhenHistoryStartsAtNonMidnightTime() |
There was a problem hiding this comment.
Can you also assert evaluateItem() leaves glpi_logs untouched for the asset? #398 has that check for the three asset types.
| // One matching row is enough | ||
| unset($request['COUNT']); | ||
| $request['SELECT'] = [Location::getTableField('id')]; | ||
| $request['LIMIT'] = 1; |
There was a problem hiding this comment.
Both callers of getCarbonIntensityDataSourceRequest() strip COUNT the same way, I'd rather have the builder return SELECT id with LIMIT 1 directly and drop these lines here and in SearchOptions.
| @@ -126,8 +138,24 @@ protected function requestCarbonIntensitiesPerDay(DateTimeImmutable $start_time, | |||
| * Returns the declared power for an asset | |||
| * @return TrackedInt | |||
| */ | |||
There was a problem hiding this comment.
The getPower() docblock ended up above getSource(), can you move it back down?
|
There is a risk that the pr breaks a fallback feature (I'm pretty sure this is not covered by a test so far). If the primary source does not have any carbon intensity data the plugin is supposed to fallback to the yearly average data for the proper territory. If there is still no data, then the yearly worldwide carbon intensity shall be used. |
|
@btry The fallback chain (realtime -> yearly territory average -> worldwide ember) in getCarbonEmissionPerDay is unchanged, the PR only caches the source and the assets source zone which do not depend on the day |
9af745c to
c2802ce
Compare
|
Please rebase this PR on top of support/1.3.0 to fix the 2 errors in unit tests. |
Description
UsageImpactcron on 5 495 missing daysisPluginActive()at init; chart scripts loaded only on the pages that can draw chartsSQL Queries
glpi_logsglpi_pluginsper requestResponse Times