Udpate tests results

This commit is contained in:
xbgmsharp
2023-09-20 00:22:10 +02:00
parent 99dea0dbc8
commit 093992443b
4 changed files with 48 additions and 17 deletions

View File

@@ -35,9 +35,25 @@ SELECT active,name,geog,stay_code FROM api.stays WHERE vessel_id = current_setti
-- Test event logs view for user
\echo 'eventlogs_view'
select count(*) from api.eventlogs_view;
SELECT count(*) from api.eventlogs_view;
-- Test event logs view for user
\echo 'stats_logs_fn'
select api.stats_logs_fn(null, null);
select api.stats_logs_fn('2022-01-01'::text,'2022-06-12'::text);
SELECT api.stats_logs_fn(null, null) INTO stats_jsonb;
SELECT stats_logs_fn->'name' AS name,
stats_logs_fn->'count' AS count,
stats_logs_fn->'max_speed' As max_speed,
stats_logs_fn->'max_distance' AS max_distance,
stats_logs_fn->'max_duration' AS max_duration,
stats_logs_fn->'max_speed_id',
stats_logs_fn->'sum_distance',
stats_logs_fn->'sum_duration',
stats_logs_fn->'max_wind_speed',
stats_logs_fn->'max_distance_id',
stats_logs_fn->'max_duration_id',
stats_logs_fn->'max_wind_speed_id',
stats_logs_fn->'first_date' IS NOT NULL AS first_date,
stats_logs_fn->'last_date' IS NOT NULL AS last_date
FROM stats_jsonb;
DROP TABLE stats_jsonb;
SELECT api.stats_logs_fn('2022-01-01'::text,'2022-06-12'::text);

View File

@@ -17,14 +17,14 @@ count | 2
logbook
-[ RECORD 1 ]--+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
name | Bollsta to Strandallén
name | Bollsta to Norra Strandgatan
_from_time | t
_to_time | t
track_geojson | t
track_gpx | t
track_geom | 0102000020E61000001A00000020D26F5F0786374030BB270F0B094E400C6E7ED60F843740AA60545227084E40D60FC48C03823740593CE27D42074E407B39D9F322803740984C158C4A064E4091ED7C3F357E3740898BB63D54054E40A8A1208B477C37404BA3DC9059044E404C5CB4EDA17A3740C4F856115B034E40A9A44E4013793740D8F0F44A59024E40E4839ECDAA773740211FF46C56014E405408D147067637408229F03B73004E40787AA52C43743740F90FE9B7AFFF4D40F8098D4D18723740C217265305FF4D4084E82303537037409A2D464AA0FE4D4022474DCE636F37402912396A72FE4D408351499D806E374088CFB02B40FE4D4076711B0DE06D3740B356C7040FFE4D404EAC66B0BC6E374058A835CD3BFE4D40D7A3703D0A6F3740D3E10EC15EFE4D4087602F277B6E3740A779C7293AFE4D4087602F277B6E3740A779C7293AFE4D402063EE5A426E3740B5A679C729FE4D40381DEE10EC6D37409ECA7C1A0AFE4D40E2C46A06CB6B37400A43F7BF36FD4D4075931804566E3740320BDAD125FD4D409A2D464AA06E37404A5658830AFD4D40029A081B9E6E37404A5658830AFD4D40
distance | 7.17
duration | 00:25:00
duration | PT25M
avg_speed | 3.6961538461538455
max_speed | 6.1
max_wind_speed | 22.1
@@ -38,7 +38,7 @@ track_geojson | t
track_gpx | t
track_geom | 0102000020E6100000130000004806A6C0EF6C3740DA1B7C6132FD4D40FE65F7E461693740226C787AA5FC4D407DD3E10EC1663740B29DEFA7C6FB4D40898BB63D5465374068479724BCFA4D409A5271F6E1633740B6847CD0B3F94D40431CEBE236623740E9263108ACF84D402C6519E2585F37407E678EBFC7F74D4096218E75715B374027C5B45C23F74D402AA913D044583740968DE1C46AF64D405AF5B9DA8A5537407BEF829B9FF54D407449C2ABD253374086C954C1A8F44D407D1A0AB278543740F2B0506B9AF34D409D11A5BDC15737406688635DDCF24D4061C3D32B655937402CAF6F3ADCF14D408988888888583740B3319C58CDF04D4021FAC8C0145837408C94405DB7EF4D40B8F9593F105B37403DC0804BEDEE4D40DE4C5FE2A25D3740AE47E17A14EE4D40DE4C5FE2A25D3740AE47E17A14EE4D40
distance | 8.6862
duration | 00:18:00
duration | PT18M
avg_speed | 6.026315789473684
max_speed | 6.5
max_wind_speed | 37.2
@@ -57,7 +57,7 @@ geog | 0101000020E6100000B0DEBBE0E68737404DA938FBF0094E40
stay_code | 2
-[ RECORD 2 ]-------------------------------------------------
active | f
name | Strandallén
name | Norra Strandgatan
geog | 0101000020E6100000029A081B9E6E37404A5658830AFD4D40
stay_code | 1
-[ RECORD 3 ]-------------------------------------------------
@@ -71,9 +71,24 @@ eventlogs_view
count | 13
stats_logs_fn
-[ RECORD 1 ]-+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stats_logs_fn | {"count": 4, "max_speed": 7.1, "max_distance": 8.6862, "max_duration": "01:11:00", "max_speed_id": 3, "sum_duration": "02:37:00", "max_wind_speed": 44.2, "max_distance_id": 2, "max_wind_speed_id": 4}
SELECT 1
-[ RECORD 1 ]+-----------
name | "kapla"
count | 4
max_speed | 7.1
max_distance | 8.6862
max_duration | PT1H11M
?column? | 3
?column? | 29.2865
?column? | PT2H37M
?column? | 44.2
?column? | 2
?column? | 4
?column? | 4
first_date | t
last_date | t
DROP TABLE
-[ RECORD 1 ]-+-
stats_logs_fn |

View File

@@ -125,18 +125,18 @@ time | t
active | t
api.logs_view
-[ RECORD 1 ]--------------
-[ RECORD 1 ]---------------
id | 2
Name | Knipan to Ekenäs
From | Knipan
To | Ekenäs
Distance | 8.6862
Duration | 00:18:00
-[ RECORD 2 ]--------------
-[ RECORD 2 ]---------------
id | 1
Name | patch log name 3
From | Bollsta
To | Strandallén
To | Norra Strandgatan
Distance | 7.17
Duration | 00:25:00
@@ -158,7 +158,7 @@ notes | new stay note 3
id | 2
vessel_id | t
active | f
name | Strandallén
name | Norra Strandgatan
latitude | 59.97688333333333
longitude | 23.4321
geog | 0101000020E6100000029A081B9E6E37404A5658830AFD4D40
@@ -185,7 +185,7 @@ stays_view
-[ RECORD 1 ]+------------------
id | 2
name | t
moorage | Strandallén
moorage | Norra Strandgatan
moorage_id | 2
duration | 00:03:00
stayed_at | Unknow
@@ -223,7 +223,7 @@ notes | new moorage note 3
-[ RECORD 2 ]---+---------------------------------------------------
id | 2
vessel_id | t
name | Strandallén
name | Norra Strandgatan
country |
stay_id | 2
stay_code | 1
@@ -245,7 +245,7 @@ total_stay | 0
arrivals_departures | 1
-[ RECORD 2 ]-------+---------------------
id | 2
moorage | Strandallén
moorage | Norra Strandgatan
default_stay | Unknow
default_stay_id | 1
total_stay | 0

View File

@@ -6,7 +6,7 @@
You are now connected to database "signalk" as user "username".
Expanded display is on.
-[ RECORD 1 ]--+-------------------------------
server_version | 15.4 (Debian 15.4-1.pgdg110+1)
server_version | 15.4 (Debian 15.4-2.pgdg110+1)
-[ RECORD 1 ]--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
postgis_full_version | POSTGIS="3.4.0 0874ea3" [EXTENSION] PGSQL="150" GEOS="3.9.0-CAPI-1.16.2" PROJ="7.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/var/lib/postgresql/.local/share/proj DATABASE_PATH=/usr/share/proj/proj.db" LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)"