arize-phoenix 11.5.0__py3-none-any.whl → 11.6.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of arize-phoenix might be problematic. Click here for more details.

@@ -11,9 +11,11 @@ from sqlalchemy import text
11
11
  from typing_extensions import assert_never
12
12
 
13
13
  from phoenix.config import (
14
+ ENV_PHOENIX_SQL_DATABASE_SCHEMA,
14
15
  get_env_database_allocated_storage_capacity_gibibytes,
15
16
  get_env_database_usage_email_warning_threshold_percentage,
16
17
  get_env_database_usage_insertion_blocking_threshold_percentage,
18
+ getenv,
17
19
  )
18
20
  from phoenix.db import models
19
21
  from phoenix.db.helpers import SupportedSQLDialect
@@ -92,14 +94,18 @@ class DbDiskUsageMonitor(DaemonTask):
92
94
  page_size = await session.scalar(text("PRAGMA page_size;"))
93
95
  current_usage_bytes = (page_count - freelist_count) * page_size
94
96
  elif self._db.dialect is SupportedSQLDialect.POSTGRESQL:
97
+ nspname = getenv(ENV_PHOENIX_SQL_DATABASE_SCHEMA) or "public"
98
+ stmt = text("""\
99
+ SELECT sum(pg_total_relation_size(c.oid))
100
+ FROM pg_class as c
101
+ INNER JOIN pg_namespace as n ON n.oid = c.relnamespace
102
+ WHERE c.relkind = 'r'
103
+ AND n.nspname = :nspname;
104
+ """).bindparams(nspname=nspname)
95
105
  async with self._db() as session:
96
- current_usage_bytes = await session.scalar(
97
- text("SELECT pg_database_size(current_database());")
98
- )
106
+ current_usage_bytes = await session.scalar(stmt)
99
107
  else:
100
108
  assert_never(self._db.dialect)
101
- if not isinstance(current_usage_bytes, (int, float)):
102
- raise TypeError(f"Expected int or float, got {type(current_usage_bytes)}")
103
109
  return float(current_usage_bytes)
104
110
 
105
111
  async def _check_thresholds(self, current_usage_gibibytes: float) -> None:
@@ -1,22 +1,22 @@
1
1
  {
2
- "_components-Bwf6zNbg.js": {
3
- "file": "assets/components-Bwf6zNbg.js",
2
+ "_components-BQP0XPOQ.js": {
3
+ "file": "assets/components-BQP0XPOQ.js",
4
4
  "name": "components",
5
5
  "imports": [
6
6
  "_vendor-DRWIRkSJ.js",
7
- "_pages-BCR8hW_l.js",
7
+ "_pages-DACgXBiR.js",
8
8
  "_vendor-arizeai-DUhQaeau.js",
9
9
  "_vendor-codemirror-D_6Q6Auv.js",
10
10
  "_vendor-three-C5WAXd5r.js"
11
11
  ]
12
12
  },
13
- "_pages-BCR8hW_l.js": {
14
- "file": "assets/pages-BCR8hW_l.js",
13
+ "_pages-DACgXBiR.js": {
14
+ "file": "assets/pages-DACgXBiR.js",
15
15
  "name": "pages",
16
16
  "imports": [
17
17
  "_vendor-DRWIRkSJ.js",
18
18
  "_vendor-arizeai-DUhQaeau.js",
19
- "_components-Bwf6zNbg.js",
19
+ "_components-BQP0XPOQ.js",
20
20
  "_vendor-codemirror-D_6Q6Auv.js",
21
21
  "_vendor-recharts-BNBwj7vz.js"
22
22
  ]
@@ -69,15 +69,15 @@
69
69
  "name": "vendor-three"
70
70
  },
71
71
  "index.tsx": {
72
- "file": "assets/index-Bfg9uQ43.js",
72
+ "file": "assets/index-CIOCExre.js",
73
73
  "name": "index",
74
74
  "src": "index.tsx",
75
75
  "isEntry": true,
76
76
  "imports": [
77
77
  "_vendor-DRWIRkSJ.js",
78
78
  "_vendor-arizeai-DUhQaeau.js",
79
- "_pages-BCR8hW_l.js",
80
- "_components-Bwf6zNbg.js",
79
+ "_pages-DACgXBiR.js",
80
+ "_components-BQP0XPOQ.js",
81
81
  "_vendor-three-C5WAXd5r.js",
82
82
  "_vendor-codemirror-D_6Q6Auv.js",
83
83
  "_vendor-shiki-k1qj_XjP.js",