Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: common_prefix displays flags as the command in statistics #2513

Open
1 task done
TopherIsSwell opened this issue Dec 31, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@TopherIsSwell
Copy link

TopherIsSwell commented Dec 31, 2024

What did you expect to happen?

with sudo in the common_prefixes, for a command like sudo -u nobody iperf3 -s -p 6969 I initially expected it to be listed under stats for iperf3.

What happened?

atuin stats lists -u as a command I've used 91 times
Output (truncated):

[          ]   96 echo             
[          ]   91 -u               
[          ]   90 go build         

Proposal

I realize that's an unreasonable expectation that all of options/flags/parameters for the prefix be stripped, since it requires understanding of the flags of every command in the common_prefixes (to know whether they interpret the following token as a parameter or not).

But maybe as a half-measure it would be tenable to strip short flags and GNU long options that appear directly after a common_prefix being stripped. In the case of the above command, it would still mislabel the command as nobody, but it wouldn't be any more wrong than labelling it as -u, and if this was done, then any flags/options that didn't have a parameter such as sudo --background updatedb or sudo -E make install would be corrected (to updatedb and make respectively).

Notes on Atuin Doctor

I've stripped out most of the zfs datasets (there were 159 and I don't think you care about them). The atuin SQLite3 database is on a separate disk from any of the zpools. It on an xfs partition (on LVM on a GPT partition on an SSD). I've experienced no performance issues.

Atuin doctor output

$ atuin doctor
Atuin Doctor
Checking for diagnostics

[Filesystem] ZFS is known to have some issues with SQLite. Atuin uses SQLite heavily. If you are having poor performance, there are some workarounds here: https://github.com/atuinsh/atuin/issues/952

Please include the output below with any bug reports or issues

{
  "atuin": {
    "version": "18.4.0",
    "sync": {
      "cloud": true,
      "records": true,
      "auto_sync": true,
      "last_sync": "2024-12-31 7:54:37.556421461 +00:00:00"
    },
    "sqlite_version": "3.46.0"
  },
  "shell": {
    "name": "bash",
    "default": "bash",
    "plugins": [
      "atuin",
      "bash-preexec"
    ],
    "preexec": "bash-preexec"
  },
  "system": {
    "os": "AlmaLinux",
    "arch": "x86_64",
    "version": "9.5",
    "disks": [
      {
        "name": "/dev/mapper/rhel_nzxt-root",
        "filesystem": "xfs"
      },
      {
        "name": "/dev/sda2",
        "filesystem": "xfs"
      },
      {
        "name": "/dev/mapper/rhel_nzxt-var",
        "filesystem": "xfs"
      },
      {
        "name": "/dev/mapper/rhel_nzxt-var_log",
        "filesystem": "xfs"
      },
      {
        "name": "/dev/sda1",
        "filesystem": "vfat"
      },
      {
        "name": "/dev/mapper/rhel_nzxt-var_tmp",
        "filesystem": "xfs"
      },
      {
        "name": "/dev/mapper/rhel_nzxt-var_log_audit",
        "filesystem": "xfs"
      },
      {
        "name": "/dev/mapper/rhel_nzxt-tmp",
        "filesystem": "xfs"
      },
      {
        "name": "/dev/mapper/rhel_nzxt-home",
        "filesystem": "xfs"
      },
      {
        "name": "array/var-lib-docker",
        "filesystem": "zfs"
      },
      {
        "name": "array",
        "filesystem": "zfs"
      },
      {
        "name": "array/var-lib-libvirt",
        "filesystem": "zfs"
      },

    ]
  }
}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@TopherIsSwell TopherIsSwell added the bug Something isn't working label Dec 31, 2024
@TopherIsSwell TopherIsSwell changed the title [Bug]: common_prefix displays flags as the command [Bug]: common_prefix displays flags as the command in statistics Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant