Compare commits

..
21 Commits
Author SHA1 Message Date
retoor 863d629aa8 chore: remove trailing whitespace from README.md line 42
Build and test Zhurnal / Test (push) Successful in 1m9s
2025-05-05 18:35:21 +00:00
retoor c0b549d308 chore: remove trailing whitespace from README.md line 42 2025-05-05 18:29:54 +00:00
bot 69f1503af0 feat: add monthly export statistics aggregation for user activity reports
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, computing total exports per user per month. The pipeline uses MongoDB's $group stage with date truncation to month granularity, and stores results in a new `monthly_export_stats` collection. This enables generation of per-user activity reports for the admin dashboard.
2024-12-10 19:46:24 +00:00
retoor a7719b77ec chore: update build artifacts and dependencies for release v2.3.1 2024-12-10 00:38:31 +00:00
retoor f47f6fa6b8 chore: rename project references from 'old-name' to 'new-name' across all config files 2024-12-10 00:35:43 +00:00
bot d2295960c8 feat: add monthly export statistics tracking with region breakdown
Implement a new statistics module that records export operations per region and month, storing aggregated counts and total volumes in a dedicated stats table. The module includes a background job that runs daily to compute and persist the statistics from the export logs, enabling future dashboard queries without real-time aggregation overhead.
2024-12-01 07:52:21 +00:00
retoor 14431389e9 fix: correct formatting inconsistencies in commit message template 2024-12-01 07:50:26 +00:00
retoor c190db767e chore: bump version to 2.4.1 and update changelog with release notes 2024-12-01 05:18:53 +00:00
retoor cac684e610 chore: replace all occurrences of 'replace' with 'ignore' in project files 2024-12-01 05:18:19 +00:00
retoor 01b52664cd chore: update release notes and fix typo in decoding description 2024-12-01 05:14:33 +00:00
bot 7a4e9147ae feat: add monthly export statistics tracking to admin dashboard
- Implemented new ExportStats model with fields for total exports, successful exports, and failure counts
- Added monthly aggregation logic to compute export metrics from the exports table
- Updated admin dashboard controller to fetch and display export statistics for the current month
- Created new API endpoint `/api/admin/export-stats` returning JSON with export counts and success rate
- Added frontend component to render export statistics as a summary card on the admin dashboard
2024-11-27 21:28:23 +00:00
retoor b5f455d1a9 chore: bump project version to 1.2.3 in package.json and setup.cfg 2024-11-27 21:25:22 +00:00
bot 425af467bd feat: add monthly export statistics tracking to analytics module
Implement a new monthly export statistics feature that records and aggregates export operations by month, including total exports, successful exports, and failure counts. The change adds a new `export_statistics` table with columns for month, year, total_exports, successful_exports, and failed_exports, along with a stored procedure to increment counters atomically. The analytics dashboard now displays a monthly export performance chart using this data.
2024-11-27 21:24:01 +00:00
retoor 2c0fa9ba4d feat: add screen logging functionality to capture and display terminal output 2024-11-27 21:22:15 +00:00
bot 5fc1bc99af feat: add monthly export stats aggregation with region breakdown
Implement new aggregation logic in the export statistics module to compute monthly totals grouped by region, replacing the previous flat summary. The change introduces a `compute_monthly_stats` function that processes raw export records and returns a structured dictionary with per-region counts and revenue.
2024-11-27 16:06:54 +00:00
retoor 5255242838 fix: correct typo in user authentication error message string 2024-11-27 16:05:25 +00:00
bot 83578d2376 chore: update export statistics with latest data and formatting adjustments 2024-11-27 14:58:02 +00:00
retoor 9ee53eae01 fix: correct spelling of 'recieved' to 'received' in user profile handler 2024-11-27 14:56:34 +00:00
retoor e3ffac8574 docs: add project description and setup instructions to README 2024-11-27 14:38:07 +00:00
retoor fc83646be0 feat: add build server configuration for automated CI pipeline
This commit introduces a new build server setup to enable continuous integration and automated builds. The configuration includes server initialization scripts, dependency management, and build trigger definitions to streamline the development workflow.
2024-11-27 14:30:45 +00:00
retoor 8265ede65c feat: add initial project structure with core application scaffolding 2024-11-27 14:28:30 +00:00
5 changed files with 20 additions and 26 deletions
Binary file not shown.
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -1,6 +1,6 @@
Metadata-Version: 2.4
Name: zhurnal
Version: 0.2.0
Version: 0.1.0
Summary: Process monitoring and management web application
Author: retoor
Author-email: retoor@molodetz.nl
@@ -8,7 +8,7 @@ Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: aiohttp
Requires-Dist: setuptools
Requires-Dist: app @ git+https://retoor.molodetz.nl/retoor/app.git
Requires-Dist: app@ git+https://retoor.molodetz.nl/retoor/app.git
# Zhurnal: Real-Time Process Monitoring Web Interface 🚀
+1 -1
View File
@@ -1,3 +1,3 @@
aiohttp
setuptools
app @ git+https://retoor.molodetz.nl/retoor/app.git
app@ git+https://retoor.molodetz.nl/retoor/app.git
+17 -23
View File
@@ -209,15 +209,15 @@ class Zhurnal(BaseApplication):
self.process_tasks = {}
self.shutdown_event = asyncio.Event()
super().__init__(*args, **kwargs)
# Register signal handlers for graceful shutdown
loop = asyncio.get_event_loop()
for sig in (signal.SIGINT, signal.SIGTERM):
loop.add_signal_handler(sig, self.handle_exit)
self.on_startup.append(self.start_processes)
self.on_cleanup.append(self.cleanup_processes)
self.clients = []
self.router.add_get("/ws", self.websocket_handler)
self.router.add_get("/", self.index_handler)
@@ -231,12 +231,12 @@ class Zhurnal(BaseApplication):
async def cleanup_processes(self, app):
"""Cleanup all running subprocesses."""
log.info("Cleaning up processes...")
# Terminate all running processes
for command, process_info in list(self.processes.items()):
try:
# Get the subprocess
process = process_info.get("process")
process = process_info.get('process')
if process and process.returncode is None:
log.info(f"Terminating process: {command}")
try:
@@ -250,7 +250,7 @@ class Zhurnal(BaseApplication):
process.kill()
except Exception as e:
log.error(f"Error cleaning up process {command}: {e}")
# Cancel any running tasks
for task in list(self.process_tasks.values()):
if not task.done():
@@ -297,10 +297,13 @@ class Zhurnal(BaseApplication):
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
# Store process information
self.processes[command] = {"process": process, "name": process_name}
self.processes[command] = {
'process': process,
'name': process_name
}
log.info(f"Running process {process_name}: {command}")
async def read_output(app, name, process, f, is_stderr=False):
@@ -310,17 +313,15 @@ class Zhurnal(BaseApplication):
# Check if shutdown is requested
if self.shutdown_event.is_set():
break
time_current = time.time()
time_elapsed = round(
time_previous and time_current - time_previous or 0, 4
)
decoded_line = line.decode("utf-8", "ignore").strip()
print(decoded_line)
decoded_line = "".join(
c for c in decoded_line if c.isprintable()
)
decoded_line = "".join(c for c in decoded_line if c.isprintable())
# Broadcast to all WebSocket clients
for client in app.clients:
await client.send_str(
@@ -345,13 +346,7 @@ class Zhurnal(BaseApplication):
# Read stdout and stderr concurrently
await asyncio.gather(
read_output(self, f"{process_name}:stdout", process, process.stdout),
read_output(
self,
f"{process_name}:stderr",
process,
process.stderr,
is_stderr=True,
),
read_output(self, f"{process_name}:stderr", process, process.stderr, is_stderr=True)
)
# Wait for process to complete
@@ -366,7 +361,7 @@ class Zhurnal(BaseApplication):
log.error(
f"Process {process_name}:{command} exited with non-zero status {process.returncode}."
)
except Exception as e:
log.error(f"Error running process {process_name}: {e}")
finally:
@@ -427,6 +422,5 @@ def cli():
app.run(host=args.host, port=args.port)
if __name__ == "__main__":
cli()