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

pkg/coveragedb: export data #5591

Open
tarasmadan opened this issue Dec 11, 2024 · 3 comments
Open

pkg/coveragedb: export data #5591

tarasmadan opened this issue Dec 11, 2024 · 3 comments

Comments

@tarasmadan
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
@dvyukov asked to export the coverage data.

Describe the solution you'd like
1 big json about 15k files and 120 instrumentation points/file, total 1,8M instrumented points.
~10 bytes/point means ~20M. It'll be the well compressible data.

The structure may be something like:

{
    "repo": "https://github.com/....",
    "commit": "012345679012345679012345679012345679",
    "managers": ["manager1", "manager2"],
    "files": [
        {
            "path": "virt/kvm/kvm_main.c",
            "lines": [1, 2, 3, 4, 5],
            "hitcounts": [0, 1, 0, 1, 0]
        },
        ...
    ]
}

It is a straightforward, cheap to export line coverage.
We'll be able to export full and per-manager data.

@dvyukov
Copy link
Collaborator

dvyukov commented Dec 11, 2024

I am not sure yet, but most likely I will need function info. Lines are only useful for humans looking at reports visually. Any source code analysis is likely to operation on function level (e.g. what functions correspond to an interface, what functions are remotely reachable, what functions are reachable by non-privileged user, etc).

@tarasmadan
Copy link
Collaborator Author

{
    "repo": "https://github.com/....",
    "commit": "012345679012345679012345679012345679",
    "managers": ["manager1", "manager2"],
    "files": [
        {
            "path": "virt/kvm/kvm_main.c",
            "functions": [
                {
                    "func1": {"lines": [1, 2, 3], "hitcounts": [0, 1, 0]},
                    "func2": {"lines": [4, 5, 6], "hitcounts": [2, 2, 2]},
                }
            ],
            ...
        },
        ...
    ]
}

Like this? Or do you think it makes sense to add "coverage" numbers?

{
    "repo": "https://github.com/....",
    "commit": "012345679012345679012345679012345679",
    "managers": ["manager1", "manager2"],
    "coverage": 0.25,
    "files": [
        {
            "path": "virt/kvm/kvm_main.c",
            "coverage": 0.1,
            "functions": [
                {
                    "func1": {"coverage": 0.03, "lines": [1, 2, 3], "hitcounts": [0, 1, 0]},
                    "func2": {"coverage": 1.0, "lines": [4, 5, 6], "hitcounts": [2, 2, 2]},
                }
            ],
            ...
        },
        ...
    ]
}

First version looks better to me...

@dvyukov
Copy link
Collaborator

dvyukov commented Dec 12, 2024

Is the only difference the derived "coverage" column? I would avoid exporting derived data, there may be multiple ways to calculate it, and there is infinite number of possible derived numbers.

But I don't know yet what exactly data is needed in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants