Undefined index: ticks

Bug #1517228 reported by Robert Lyon on 2015-11-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Low
Robert Lyon
1.10
Low
Unassigned
15.04
Low
Unassigned
15.10
Low
Unassigned

Bug Description

There is a function in mahara called perf_to_log which retrieves some performance information from get_performance_info(), turns it to a string and adds the string to log file.

But there is a problem with it.

the get_performance_info() does a check for things but the perf_to_log expects all options to exist.

This is annoying as it fills up the error log with crud we don't need

Changed in mahara:
status: New → In Progress
Aaron Wells (u-aaronw) wrote :

It's worth noting, our get_performance_info() method is based on Moodle's: https://github.com/moodle/moodle/blob/master/lib/moodlelib.php#L8742

Theirs has remained essentially the same as ours. The main changes since we copied it, are changes in formatting, and they've got sections for getting performance from some of their components like the filter manager, string manager, and cache system.

They also added a check on the size of the session object, which might be a good idea for us to do as well.

Aaron Wells (u-aaronw) wrote :

Also interesting to note that there are no specifics differences in behavior across platforms in the PHP manual page for the function get_posix_times() (which is what's causing our problems). Well, it does note that it doesn't work at all on Windows platforms (because they are not POSIX), but it apparently also doesn't work on some POSIX systems, such as FreeBSD. http://php.net/manual/en/function.posix-times.php

Reviewed: https://reviews.mahara.org/5733
Committed: https://git.mahara.org/mahara/mahara/commit/e9584a54cc890b3f9bd0ba7cab57b600a4a836a2
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit e9584a54cc890b3f9bd0ba7cab57b600a4a836a2
Author: Robert Lyon <email address hidden>
Date: Wed Nov 18 11:29:16 2015 +1300

Bug 1517228: perf_to_log function amd misisng data

Because some systems may not have all the available data we should
check if the data exists before trying to display it.

To test:
Before patch change the line in lib/mahara.php
if (function_exists('posix_times')) {
to
if (!function_exists('posix_times')) {

and make sure the 'perf_to_log' config option is set to true

This will cause the errors we are trying to deal with to show up

behatnotneeded

Change-Id: If9610fa0eaf4c8bb036b21c1c75e10d828de7934
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2015-11-20
Changed in mahara:
status: In Progress → Fix Committed
Mahara Bot (dev-mahara) wrote :

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/5757

Mahara Bot (dev-mahara) wrote :

Patch for "1.10_STABLE" branch: https://reviews.mahara.org/5758

Reviewed: https://reviews.mahara.org/5758
Committed: https://git.mahara.org/mahara/mahara/commit/296fe5198efff7a84f708c796ff9556385e4fe80
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.10_STABLE

commit 296fe5198efff7a84f708c796ff9556385e4fe80
Author: Robert Lyon <email address hidden>
Date: Wed Nov 18 11:29:16 2015 +1300

Bug 1517228: perf_to_log function amd misisng data

Because some systems may not have all the available data we should
check if the data exists before trying to display it.

To test:
Before patch change the line in lib/mahara.php
if (function_exists('posix_times')) {
to
if (!function_exists('posix_times')) {

and make sure the 'perf_to_log' config option is set to true

This will cause the errors we are trying to deal with to show up

behatnotneeded

Change-Id: If9610fa0eaf4c8bb036b21c1c75e10d828de7934
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e9584a54cc890b3f9bd0ba7cab57b600a4a836a2)

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/5757
Committed: https://git.mahara.org/mahara/mahara/commit/a57aee9f7a3acea1a5ad7787286c3220d7f2b017
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit a57aee9f7a3acea1a5ad7787286c3220d7f2b017
Author: Robert Lyon <email address hidden>
Date: Wed Nov 18 11:29:16 2015 +1300

Bug 1517228: perf_to_log function amd misisng data

Because some systems may not have all the available data we should
check if the data exists before trying to display it.

To test:
Before patch change the line in lib/mahara.php
if (function_exists('posix_times')) {
to
if (!function_exists('posix_times')) {

and make sure the 'perf_to_log' config option is set to true

This will cause the errors we are trying to deal with to show up

behatnotneeded

Change-Id: If9610fa0eaf4c8bb036b21c1c75e10d828de7934
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e9584a54cc890b3f9bd0ba7cab57b600a4a836a2)

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/5756
Committed: https://git.mahara.org/mahara/mahara/commit/5e5da020062e81d36480a147844b598249f335ea
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit 5e5da020062e81d36480a147844b598249f335ea
Author: Robert Lyon <email address hidden>
Date: Wed Nov 18 11:29:16 2015 +1300

Bug 1517228: perf_to_log function amd misisng data

Because some systems may not have all the available data we should
check if the data exists before trying to display it.

To test:
Before patch change the line in lib/mahara.php
if (function_exists('posix_times')) {
to
if (!function_exists('posix_times')) {

and make sure the 'perf_to_log' config option is set to true

This will cause the errors we are trying to deal with to show up

behatnotneeded

Change-Id: If9610fa0eaf4c8bb036b21c1c75e10d828de7934
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e9584a54cc890b3f9bd0ba7cab57b600a4a836a2)

no longer affects: mahara/16.04
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers