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

[FEATURE] Add execution statistics to Apalache #288

Closed
lemmy opened this issue Oct 16, 2020 · 29 comments
Closed

[FEATURE] Add execution statistics to Apalache #288

lemmy opened this issue Oct 16, 2020 · 29 comments
Assignees
Labels
Finfra-high Feature: Infrastructure improvements high prio new New issue to be triaged.

Comments

@lemmy
Copy link
Contributor

lemmy commented Oct 16, 2020

@konnov asked during the TLA+ Community Event about worldwide TLA+ user numbers. TLC happens to collect execution statistics that give us a rough approximate. Does Apalache want to integrate it execution statistics collection as well? I'm happy to share all the technical details if sending statistics to INRIA is not a no-go. What's collected (for TLC) is listed at https://github.com/tlaplus/tlaplus/blob/master/tlatools/org.lamport.tlatools/src/util/ExecutionStatisticsCollector.md and the data is publicly shared.

slightly related: tlaplus/vscode-tlaplus#114

@lemmy lemmy added the new New issue to be triaged. label Oct 16, 2020
@konnov
Copy link
Collaborator

konnov commented Oct 17, 2020

It would not be a problem for us to ping the INRIA server. However, the users might get worried that we are spying on them. Would it be more reasonable to have a joint announcements list, so people would be asked to subscribe to it when they use TLC, Apalache, the VScode extension, etc?

@lemmy
Copy link
Contributor Author

lemmy commented Oct 17, 2020

The Toolbox prompts users to explicitly opt-in:
opt67240009-618aa200-f405-11e9-840e-05e165b92dd0

@konnov
Copy link
Collaborator

konnov commented Oct 22, 2020

Right. That makes sense in the Toolbox. We probably can add an opt-in option in the command-line. But I doubt anybody would trigger it :-)

@lemmy
Copy link
Contributor Author

lemmy commented Oct 22, 2020

Prompting users to opt-in is the task of IDEs such as the Toolbox, VSCode, .... Like TLC, Apalache would simply report stats iff ~/.tlaplus/esc.txt exists and has an opt-in marker:

https://github.com/tlaplus/tlaplus/blob/master/tlatools/org.lamport.tlatools/src/util/ExecutionStatisticsCollector.java

@konnov
Copy link
Collaborator

konnov commented Oct 23, 2020

How about the following. We isolate all the statistics collection in a well-defined script called bin/opt-in-report-stat. The model checker script bin/apalache-mc warns the user about the option of turning on the statistics collection. We add two commands to apalache-mc, e.g., --feedback-allow, --feedback-shutup. The command --feedback-allow writes REPORT_FEEDBACK=1 in ~/.apalache/feedback.rc, whereas the command --feedback-shutup write REPORT_FEEDBACK=0 in ~/.apalache/feedback.rc. The script bin/opt-in-report-stat uses this configuration file.

@shonfeder , what is your opinion?

@konnov
Copy link
Collaborator

konnov commented Oct 23, 2020

We will also have to add a page explaining what we collect and how we do that. The large part is already written by @lemmy: https://github.com/tlaplus/tlaplus/blob/master/tlatools/org.lamport.tlatools/src/util/ExecutionStatisticsCollector.md

@konnov konnov added this to the v0.14.0-infrastructure milestone Oct 23, 2020
@shonfeder
Copy link
Contributor

shonfeder commented Oct 23, 2020

The approach sounds OK to me, but I don't know anything about this stuff and I'm not sure how the script will work to monitor the stats we want to collect. I've never implemented or facilitated any end-user telemetry before.

Wrapping stuff in additional scripts doesn't seem ideal to me, tho I get that this is for the sake of isolating the spying telemetry code.

Having a dedicated file for setting one flag seems non-ideal. Should we just have a more general configuration file with this as our first option?

edited to correcter terminology

@lemmy
Copy link
Contributor Author

lemmy commented Oct 23, 2020

What is the reason to re-write execution statistics/telemetry data collection? I created the issue, assuming that you would re-use the existing ExecutionStatisticsCollector and we change the wording in the Toolboxes (Eclipse & VSCode) to include Apalache and TLC. If you develop your own telemetry implementation, it is probably best to also separate the backend.

Btw. I very much value my privacy, but I think the term "spying" shouldn't be used in this context. It is telemetry data, users have to explicitly opt-in, and the collected data is publicly shared--quite different to how spies operate.

@konnov
Copy link
Collaborator

konnov commented Oct 23, 2020

I don't think we have to invent our own telemetry. Just call yours in a different instance of java inside the script.

@lemmy
Copy link
Contributor Author

lemmy commented Oct 23, 2020

IMO this leads to an infrastructure question: Do you expect the Toolboxes to launch Apalache via the apalache-mc script in the long run?

@konnov
Copy link
Collaborator

konnov commented Oct 23, 2020

I don't think so. We have the class called Tool that can be called from JVM. However, Toolbox gathers the statistics itself, right?

@lemmy
Copy link
Contributor Author

lemmy commented Oct 23, 2020

No, the Toolbox (Eclipse & VScode) simply creates the file ~/.tlaplus/esc.txt and leave the actual reporting to the tool. The reason being that the Toolbox doesn't have access to all of the telemetry data.

@konnov konnov added the Finfra-backlog Feature: Infrastructure improvements backlog label Dec 6, 2020
@konnov konnov modified the milestones: v0.14.0-infrastructure, backlog2021 Dec 11, 2020
@konnov konnov self-assigned this Jan 8, 2021
@konnov konnov modified the milestones: backlog2021, January iteration Jan 8, 2021
@konnov
Copy link
Collaborator

konnov commented Jan 8, 2021

I will check, whether we can quickly plug-in telemetry and add the opt-in option.

@konnov konnov added Finfra-high Feature: Infrastructure improvements high prio and removed Finfra-backlog Feature: Infrastructure improvements backlog labels Jan 8, 2021
@konnov
Copy link
Collaborator

konnov commented Jan 8, 2021

See #415

@konnov
Copy link
Collaborator

konnov commented Jan 8, 2021

@lemmy the opt-in message in Toolbox is talking about TLC. Could you also add a line that this opt-in works for Apalache (and probably other TLA+ tools) too? Otherwise, it may be seen as an unexpected behavior.

@lemmy
Copy link
Contributor Author

lemmy commented Jan 8, 2021

It's perhaps best to replace TLC with TLA+ Tools.

@lemmy
Copy link
Contributor Author

lemmy commented Jan 8, 2021

Are all other items of the list going to apply?

Total number of cores and cores assigned to TLC
Heap and off-heap memory allocated to TLC
TLC version (git commit SHA)
If breadth-first search, depth-first search or simulation mode is active
TLC implemenation for the sets of seen and unseen states
If TLC has been launched from an IDE
Name, version, and architecture of the OS
Vendor, version, and architecture of JVM
The current date and time
An installation ID which allows to group execution statistic (optionally)

@konnov
Copy link
Collaborator

konnov commented Jan 9, 2021

So far, here is what I managed to report:

  • Total number of cores and cores assigned (the latter is 1 for now, but will change soon)
  • Heap memory (I am not sure what to do about the off-heap memory)
  • Version (semantic version + build)
  • mode: parse, check, typecheck
  • do you want to know, if Apalache is run in an IDE?
  • Name, version, and architecture of the OS
  • Vendor, version, and architecture of JVM
  • Timestamp
  • An installation ID which allows to group execution statistic (optionally)

We only enable/disable statistics in the apalache command line. There is no choice between ID and no ID. But if the ID is disabled in Toolbox, your code will respect it.

@konnov
Copy link
Collaborator

konnov commented Jan 9, 2021

This one is done.

@konnov konnov closed this as completed Jan 9, 2021
@lemmy
Copy link
Contributor Author

lemmy commented Jan 10, 2021

So far, I don't see Apalache stats in the data.

@konnov
Copy link
Collaborator

konnov commented Jan 11, 2021

There should be a few entries when I tried to run it on my computer. Apart from that, it is not released yet.

@konnov konnov reopened this Jan 11, 2021
@konnov
Copy link
Collaborator

konnov commented Jan 11, 2021

It is showing up here: https://exec-stats.tlapl.us/

Can it be a parsing problem? E.g., our version string is longer than that of TLC.

@lemmy
Copy link
Contributor Author

lemmy commented Jan 11, 2021

To keep the backend simple, can you please also report:

result.put("osVersion", System.getProperty("os.version"));
result.put("jvmOffHeapMem", "0");

@konnov
Copy link
Collaborator

konnov commented Jan 11, 2021

Added. Just have to wait until PR is built.

@konnov
Copy link
Collaborator

konnov commented Jan 11, 2021

There is at least one entry at exec-stats now and I see the apalache entry!

@konnov
Copy link
Collaborator

konnov commented Jan 11, 2021

Closing the issue.

@konnov konnov closed this as completed Jan 11, 2021
@lemmy
Copy link
Contributor Author

lemmy commented Jan 12, 2021

  • do you want to know, if Apalache is run in an IDE?

I and others have been setting ide to e.g. "github" when TLC runs as part of automation.

@konnov
Copy link
Collaborator

konnov commented Jan 12, 2021

Why would you collect stats for the github runs?

@lemmy
Copy link
Contributor Author

lemmy commented Jan 12, 2021

Why not? It tells if users run our tools as part of automation and we can easily exclude the datapoints via ide in other queries. For example, I wouldn't be surprised if automation correlates with beefier machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Finfra-high Feature: Infrastructure improvements high prio new New issue to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants