Skip to content

Add compression ratio logging for rotated pcap uploads#1

Merged
pavel-odintsov merged 7 commits into
mainfrom
copilot/update-compression-logging
May 14, 2026
Merged

Add compression ratio logging for rotated pcap uploads#1
pavel-odintsov merged 7 commits into
mainfrom
copilot/update-compression-logging

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

This updates the compression/upload path to include compression ratio details in the existing log stream. The new log entry makes it easier to see how effectively each rotated pcap was compressed before upload.

  • Compression logging

    • Capture original and compressed file sizes in compressAndUpload
    • Log a single post-compression summary with source file, compressed file, byte sizes, and ratio
  • Edge-case handling

    • Report ratio unavailable for zero-byte input or zero-byte compressed output
    • Differentiate empty input vs. empty compressed file in the log text
  • Focused coverage

    • Add unit tests for compression stats formatting, including normal and zero-size cases

Example log output:

log.Printf("Compression complete: %s", compressionStats)
// capture.pcap -> capture.pcap.bz2 (1024 bytes -> 256 bytes, ratio 4.00:1)
Original prompt

Update repository FastNetMon/cloud_pcap to add logic that prints the compression ratio in the log file. Investigate where compression/upload logging currently happens, implement logging of the compression ratio in an appropriate place, and create a pull request with the change. Keep the existing logging style and ensure the new log output is clear and useful.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Add logic to print comprssion ratio in log file

Assistant: I’m waiting for your response to the GitHub confirmation dialog so I can continue with creating the change as a pull request.

This pull request was created from Copilot chat.

Copilot AI and others added 6 commits May 14, 2026 15:01
Agent-Logs-Url: https://github.com/FastNetMon/cloud_pcap/sessions/af04ef1b-7dee-432d-8d88-102862ec4f81

Co-authored-by: pavel-odintsov <2744166+pavel-odintsov@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FastNetMon/cloud_pcap/sessions/af04ef1b-7dee-432d-8d88-102862ec4f81

Co-authored-by: pavel-odintsov <2744166+pavel-odintsov@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FastNetMon/cloud_pcap/sessions/af04ef1b-7dee-432d-8d88-102862ec4f81

Co-authored-by: pavel-odintsov <2744166+pavel-odintsov@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FastNetMon/cloud_pcap/sessions/af04ef1b-7dee-432d-8d88-102862ec4f81

Co-authored-by: pavel-odintsov <2744166+pavel-odintsov@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FastNetMon/cloud_pcap/sessions/af04ef1b-7dee-432d-8d88-102862ec4f81

Co-authored-by: pavel-odintsov <2744166+pavel-odintsov@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FastNetMon/cloud_pcap/sessions/af04ef1b-7dee-432d-8d88-102862ec4f81

Co-authored-by: pavel-odintsov <2744166+pavel-odintsov@users.noreply.github.com>
Copilot AI changed the title [WIP] Add logic to print compression ratio in log file Add compression ratio logging for rotated pcap uploads May 14, 2026
Copilot AI requested a review from pavel-odintsov May 14, 2026 15:08
@pavel-odintsov pavel-odintsov marked this pull request as ready for review May 14, 2026 15:12
@pavel-odintsov pavel-odintsov merged commit 3930481 into main May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants