Skip to content

Commit

Permalink
Min session size to show/merge now is config variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
adel-s committed Feb 15, 2017
1 parent a1b3eb8 commit a0e6ff8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions web/creds-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@

$hide_empty_variables = true;
$show_session_length = true;

#Sessions less than limit will not be shown
$min_session_size = 20;

//echo "<!-- End creds.php -->\r\n";
?>
5 changes: 2 additions & 3 deletions web/get_sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@
$session_duration_str = gmdate("H:i:s", ($row["timeend"] - $row["timestart"])/1000);
$session_profileName = $row["profileName"];

// Drop sessions smaller than 60 data points
//if ($row["sessionsize"] >= 60) {
if ($row["sessionsize"] >= 20) {
// Do not show sessions smaller than $min_session_size
if ($session_size >= $min_session_size) {
$sid = $row["session"];
$sids[] = preg_replace('/\D/', '', $sid);
$seshdates[$sid] = date("F d, Y h:ia", substr($sid, 0, -3));
Expand Down
2 changes: 1 addition & 1 deletion web/merge_sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</thead>
<tbody>
<?php
$sessqry = mysqli_query($con, "SELECT timestart, timeend, session, profileName, sessionsize FROM $db_sessions_table WHERE sessionsize >= 20 ORDER BY session desc") or die(mysqli_error($con));
$sessqry = mysqli_query($con, "SELECT timestart, timeend, session, profileName, sessionsize FROM $db_sessions_table WHERE sessionsize >= $min_session_size ORDER BY session desc") or die(mysqli_error($con));
$i = 0;
while ($x = mysqli_fetch_array($sessqry)) {
?>
Expand Down

1 comment on commit a0e6ff8

@adel-s
Copy link
Owner Author

@adel-s adel-s commented on a0e6ff8 Feb 15, 2017

Choose a reason for hiding this comment

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

Sometimes I just 'warmup' my car without driving anywhere. So I need an ability to operate this short sessions.
Setting $min_session_size=0 lets me to see all sessions, no matter how short they are. In default settings it set to 20 for backward compatibility.

Please sign in to comment.