2021-07-30 13:58:57 -04:00
|
|
|
-- Copyright (c) HashiCorp, Inc.
|
2023-02-02 17:15:17 -08:00
|
|
|
-- SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2021-07-30 13:58:57 -04:00
|
|
|
begin;
|
|
|
|
|
select plan(8);
|
|
|
|
|
|
2023-05-17 10:18:58 -04:00
|
|
|
select is(count(*), 1::bigint) from wh_session_connection_accumulating_fact where connection_id = 's1c1___clare';
|
|
|
|
|
select is(bytes_up, null) from wh_session_connection_accumulating_fact where connection_id = 's1c1___clare';
|
|
|
|
|
select is(bytes_down, null) from wh_session_connection_accumulating_fact where connection_id = 's1c1___clare';
|
|
|
|
|
select is(connection_closed_time, 'infinity'::wh_timestamp) from wh_session_connection_accumulating_fact where connection_id = 's1c1___clare';
|
2021-07-30 13:58:57 -04:00
|
|
|
|
|
|
|
|
update session_connection set
|
|
|
|
|
bytes_up = 10,
|
|
|
|
|
bytes_down = 5,
|
2024-07-23 14:19:21 -04:00
|
|
|
closed_reason = 'closed by end-user',
|
|
|
|
|
connected_time_range = tstzrange(now()::wh_timestamp, now()::wh_timestamp)
|
2023-05-17 10:18:58 -04:00
|
|
|
where public_id = 's1c1___clare';
|
2021-07-30 13:58:57 -04:00
|
|
|
|
2023-05-25 15:19:42 +00:00
|
|
|
select is(count(*), 2::bigint) from wh_session_connection_accumulating_fact;
|
2023-05-17 10:18:58 -04:00
|
|
|
select is(bytes_up, 10::wh_bytes_transmitted) from wh_session_connection_accumulating_fact where connection_id = 's1c1___clare';
|
|
|
|
|
select is(bytes_down, 5::wh_bytes_transmitted) from wh_session_connection_accumulating_fact where connection_id = 's1c1___clare';
|
|
|
|
|
select is(connection_closed_time, now()::wh_timestamp) from wh_session_connection_accumulating_fact where connection_id = 's1c1___clare';
|
2021-07-30 13:58:57 -04:00
|
|
|
|
|
|
|
|
select * from finish();
|
|
|
|
|
rollback;
|