Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2016-2023 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT).
19 *
20 */
21
22namespace oat\taoClientDiagnostic\model\storage;
23
24/**
25 * Interface Storage
26 * @package oat\taoClientDiagnostic\model\storage
27 */
28interface Storage
29{
30    public const SERVICE_ID = 'taoClientDiagnostic/storage';
31
32    /**
33     * All columns of diagnostic storage
34     */
35    public const DIAGNOSTIC_ID                   = 'id';
36    public const DIAGNOSTIC_CONTEXT_ID           = 'context_id';
37    public const DIAGNOSTIC_USER_ID              = 'user_id';
38    public const DIAGNOSTIC_LOGIN                = 'login';
39    public const DIAGNOSTIC_IP                   = 'ip';
40    public const DIAGNOSTIC_WORKSTATION          = 'workstation';
41    public const DIAGNOSTIC_SCHOOL_NAME          = 'school_name';
42    public const DIAGNOSTIC_SCHOOL_ID            = 'school_id';
43    public const DIAGNOSTIC_SCHOOL_NUMBER        = 'school_number';
44    public const DIAGNOSTIC_FINGERPRINT_UUID     = 'fingerprint_uuid';
45    public const DIAGNOSTIC_FINGERPRINT_VALUE    = 'fingerprint_value';
46    public const DIAGNOSTIC_FINGERPRINT_DETAILS  = 'fingerprint_details';
47    public const DIAGNOSTIC_FINGERPRINT_ERRORS   = 'fingerprint_errors';
48    public const DIAGNOSTIC_FINGERPRINT_CHANGED  = 'fingerprint_changed';
49    public const DIAGNOSTIC_BROWSER              = 'browser';
50    public const DIAGNOSTIC_BROWSERVERSION       = 'browser_version';
51    public const DIAGNOSTIC_OS                   = 'os';
52    public const DIAGNOSTIC_OSVERSION            = 'os_version';
53    public const DIAGNOSTIC_COMPATIBLE           = 'compatible';
54    public const DIAGNOSTIC_VERSION              = 'version';
55    public const DIAGNOSTIC_SCREEN_WIDTH         = 'screen_width';
56    public const DIAGNOSTIC_SCREEN_HEIGHT        = 'screen_height';
57    public const DIAGNOSTIC_BANDWIDTH_MIN        = 'bandwidth_min';
58    public const DIAGNOSTIC_BANDWIDTH_MAX        = 'bandwidth_max';
59    public const DIAGNOSTIC_BANDWIDTH_SUM        = 'bandwidth_sum';
60    public const DIAGNOSTIC_BANDWIDTH_COUNT      = 'bandwidth_count';
61    public const DIAGNOSTIC_BANDWIDTH_AVERAGE    = 'bandwidth_average';
62    public const DIAGNOSTIC_BANDWIDTH_MEDIAN     = 'bandwidth_median';
63    public const DIAGNOSTIC_BANDWIDTH_VARIANCE   = 'bandwidth_variance';
64    public const DIAGNOSTIC_BANDWIDTH_DURATION   = 'bandwidth_duration';
65    public const DIAGNOSTIC_BANDWIDTH_SIZE       = 'bandwidth_size';
66    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_MIN        = 'intensive_bandwidth_min';
67    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_MAX        = 'intensive_bandwidth_max';
68    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_SUM        = 'intensive_bandwidth_sum';
69    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_COUNT      = 'intensive_bandwidth_count';
70    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_AVERAGE    = 'intensive_bandwidth_average';
71    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_MEDIAN     = 'intensive_bandwidth_median';
72    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_VARIANCE   = 'intensive_bandwidth_variance';
73    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_DURATION   = 'intensive_bandwidth_duration';
74    public const DIAGNOSTIC_INTENSIVE_BANDWIDTH_SIZE       = 'intensive_bandwidth_size';
75    public const DIAGNOSTIC_PERFORMANCE_MIN      = 'performance_min';
76    public const DIAGNOSTIC_PERFORMANCE_MAX      = 'performance_max';
77    public const DIAGNOSTIC_PERFORMANCE_SUM      = 'performance_sum';
78    public const DIAGNOSTIC_PERFORMANCE_COUNT    = 'performance_count';
79    public const DIAGNOSTIC_PERFORMANCE_AVERAGE  = 'performance_average';
80    public const DIAGNOSTIC_PERFORMANCE_MEDIAN   = 'performance_median';
81    public const DIAGNOSTIC_PERFORMANCE_VARIANCE = 'performance_variance';
82    public const DIAGNOSTIC_CREATED_AT           = 'created_at';
83    public const DIAGNOSTIC_UPLOAD_MAX           = 'upload_max';
84    public const DIAGNOSTIC_UPLOAD_AVG           = 'upload_avg';
85
86    /**
87     * Store data into storage model based on entity
88     * It should support insert or update
89     * @param $id
90     * @param $data
91     * @return mixed
92     */
93    public function store($id, $data);
94
95    /**
96     * Flush the diagnostic records
97     * @return bool whether the flush goes well or not
98     */
99    public function flush();
100}