From f40eb75819dc363fbc4a084a687534f4cd8501e7 Mon Sep 17 00:00:00 2001
From: stedif <stefano.difrischia@inaf.it>
Date: Fri, 17 Sep 2021 14:58:37 +0200
Subject: [PATCH] L2SS-235: fix get archive load bug

---
 devices/toolkit/archiver.py                   |  2 +-
 jupyter-notebooks/PCC_archive_attribute.ipynb | 19 +++++++++++--------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/devices/toolkit/archiver.py b/devices/toolkit/archiver.py
index fe3b1f87d..aa67d66a1 100644
--- a/devices/toolkit/archiver.py
+++ b/devices/toolkit/archiver.py
@@ -216,7 +216,7 @@ class Archiver():
         if use_freq:
             return str(es.AttributeRecordFreq)+(' events/period' )
         else:
-            return len(es.AttributeList)
+            return len(es.AttributeList or []) 
     
 class AttributeFormatException(Exception):
     """
diff --git a/jupyter-notebooks/PCC_archive_attribute.ipynb b/jupyter-notebooks/PCC_archive_attribute.ipynb
index d2e413b68..46ce0fafc 100644
--- a/jupyter-notebooks/PCC_archive_attribute.ipynb
+++ b/jupyter-notebooks/PCC_archive_attribute.ipynb
@@ -226,24 +226,27 @@
   {
    "cell_type": "code",
    "execution_count": null,
-   "id": "a0e8dcab",
+   "id": "1c753ed9",
    "metadata": {},
    "outputs": [],
    "source": [
-    "# Turn off the device\n",
-    "d.off()\n",
-    "# Remove attribute from archiving list\n",
-    "#archiver.remove_attribute_from_archiver(attr_fq_name)\n",
-    "#archiver.remove_attributes_by_device(device_name)"
+    "# Count number of archive events per minute\n",
+    "archiver.get_subscriber_load()"
    ]
   },
   {
    "cell_type": "code",
    "execution_count": null,
-   "id": "32ab34a9",
+   "id": "a0e8dcab",
    "metadata": {},
    "outputs": [],
-   "source": []
+   "source": [
+    "# Turn off the device\n",
+    "d.off()\n",
+    "# Remove attribute from archiving list\n",
+    "#archiver.remove_attribute_from_archiver(attr_fq_name)\n",
+    "#archiver.remove_attributes_by_device(device_name)"
+   ]
   }
  ],
  "metadata": {
-- 
GitLab