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

encrypted messages stats #20

Conversation

jcgruenhage
Copy link
Contributor

I wanted to write a DB migration for this, but it seems like panopticon doesn't handle migrations at all. How have you been dealing with this internally, are these migrations part of your secret ansible sauce, or are you doing the migrations by hand?

@jcgruenhage
Copy link
Contributor Author

Side note: There's two commits in here, aside of the actual change I fixed a mistake in the descriptions of the daily_messages and daily_sent_messages stats.

@clokep
Copy link
Member

clokep commented Feb 1, 2021

are you doing the migrations by hand?

If memory serves me correct, we've been doing them by hand.

@clokep
Copy link
Member

clokep commented Feb 1, 2021

This might benefit from some tests added, see https://github.com/matrix-org/panopticon/tree/master/tests This would be adding a new file test_push_good_before_1.27.0.sh (or maybe 1.28.0 depending on when the synapse PR is merged) with the current test in test_push_good.sh and then modifying test_push_good.sh with the new data (#17 recently did this for an example).

@jcgruenhage
Copy link
Contributor Author

jcgruenhage commented Feb 1, 2021

This might benefit from some tests added, see https://github.com/matrix-org/panopticon/tree/master/tests This would be adding a new file test_push_good_before_1.27.0.sh (or maybe 1.28.0 depending on when the synapse PR is merged) with the current test in test_push_good.sh and then modifying test_push_good.sh with the new data (#17 recently did this for an example).

I was about to do that when I wrote the code, and then realized that the tests there already don't include most of the metrics. If you still think it's helpful, I can do it, but I'm not really convinced.

Aside of that, the test cases are not in great shape in general. The lines are freakishly long, most test cases are duplicated among the scripts anyway. Instead, it'd probably make more sense to unify those into a single script, and have a few json/csv files with the request body/expected result in them.

While I obviously have opinions about this, I don't really feel like fixing it in the current state. This whole repo is a bit messy, home-grown shell based tests, no db migrations, two different languages, etc. For those reasons, we're currently considering @ famedly.com to just rewrite panopticon in rust, having a single tool that does both collection and aggregation, including database migration and tests run inside cargo test directly. If we were to do that, and released it under a license you're happy with, would you consider using it as well and collaborating on it? I don't think it makes much sense to have two separate implementations for this, but at the same time, the current implementation of panopticon is really a pain to work on and upgrade. If it makes much of a difference to you, I'm relatively sure we could also donate the code to the matrix foundation and have it live here, as a replacement for the current implementation.

Updated state: We've started implementing this as an intro project for a new hire, so it'll likely take a bit longer than originally anticipated, but expect this to become available soon-ish.

@neilisfragile
Copy link
Contributor

Hi @jcgruenhage thanks for the PR (sorry for the lag), this is really great. I would like to see tests, be we can handle that.

In terms of the codebase overall, it is true that it could do with some love, but I would prefer to evolve what we have rather than rewrite, not least because the team principally maintaining it has more experience in Go and Python than Rust.

Obviously, nothing stops you from rewriting anyway, but the matrix.org hosted panopticon will continue to run the existing implementation.

On the plus side, this might be the kick we need to do some basic modernising 😄

Copy link
Contributor

@neilisfragile neilisfragile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM merging as is. Tests to follow.

@neilisfragile neilisfragile merged commit 7b741cc into matrix-org:master Feb 22, 2021
@jcgruenhage
Copy link
Contributor Author

Hi @jcgruenhage thanks for the PR (sorry for the lag), this is really great. I would like to see tests, be we can handle that.

No worries, we need this too obviously, since we're still running panopticon ourselves

In terms of the codebase overall, it is true that it could do with some love, but I would prefer to evolve what we have rather than rewrite, not least because the team principally maintaining it has more experience in Go and Python than Rust.

I totally get that having a zoo of languages is problematic, which is one of the reasons we chose to go with Rust, because our backend team has more experience with Rust. As for maintainership tasks: We can handle all that, and we'll definitely add all metrics that end up being send by synapse, so there's basically nothing you'd need to do here, if you wanted to use it.

Obviously, nothing stops you from rewriting anyway, but the matrix.org hosted panopticon will continue to run the existing implementation.

👍

On the plus side, this might be the kick we need to do some basic modernising

And if not, we'll always be happy to have you on our implementation if you end up changing your mind.

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.

3 participants