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

Update discord heatmaps analytics #74

Closed
3 tasks done
amindadgar opened this issue May 7, 2024 · 0 comments · Fixed by #91
Closed
3 tasks done

Update discord heatmaps analytics #74

amindadgar opened this issue May 7, 2024 · 0 comments · Fixed by #91

Comments

@amindadgar
Copy link
Member

amindadgar commented May 7, 2024

Update Heatmaps Analytics

As we're moving to refactor the discord-analyzer to be an analyzer and accept any general data structure, we need to refactor and improve different parts of it.
The heatmaps analytics is one another part of the analyzer that needs to be refactored. Basically, it has two parts of 1) hourly analytics and 2) raw analytics
Hourly Analytics: The hourly analytics is representative of what is the count messages were available in each hour of day for a specific platform data filtering. I.e.: for the discord platform, the filterings would be thread and channel.
Raw Analytics: The raw analytics is saying at a specific day, how many interactions and actions were done by each user and if it was an interaction, which people were engaged in that interaction.

For each platform, we would have a predefined config for each heatmap document, and we're going to align our heatmaps based on that config

Discord heatmaps config


{
  "platform": "discord",
  "date": Date,
  "channel_id": "string",
  "hourlyAnalytics": [
    {
      "name": "thr_messages",
      "type": Activity.action, 
      "memberactivitiesUsed": false,
      "metadata_condition": {
            "threadId": {"$ne": null},
      }
    },
    {
      "name": "lone_messages",
      "type": Activity.action, 
      "memberactivitiesUsed": false,
      "metadata_condition": {
            "threadId": null,
      }
    },
    {
      "name": "replier",
      "count": Array,
      "type": Activity.interaction,
      "memberactivitiesUsed": false
    },
    {
      "name": "replied",
      "count": Array,
      "type": Activity.interaction,
      "memberactivitiesUsed": false
    },
    {
      "name": "mentioner",
      "type": Activity.interaction, 
      "memberactivitiesUsed": false
    },
    {
      "name": "mentioned",
      "type": Activity.interaction,
      "memberactivitiesUsed": false
    },
    {
	"name": "reacter",
	"count": Array,
	"type": Activity.action,
	"memberactivitiesUsed": true
    },
    {
	"name": "reacted",
	"count": Array,
	"type": Activity.action,
	"memberactivitiesUsed": true
    }
  ],
  "raw_analytics": [
    {
	"name": "replied_per_acc",
	"type": Activity.interaction,
	"memberactivitiesUsed": true
    },
    {
	"name": "mentioner_per_acc",
	"type": Activity.interaction,
	"memberactivitiesUsed": true
    },
    {
	"name": "reacted_per_acc",
	"type": Activity.interaction,
	"memberactivitiesUsed": true
    }
  ]
}

Note: the metadata_condition means that the analytics would compute this data based on specific criteria of the rawmemberactivities metadata. The conditions are MongoDB filters.

The tasks are

  • Define the predefined configs in a directory
  • Re-write the hourly analytics and do the hourly analytics via MongoDB for each day and produce results based on the predefined configs.
  • Re-write the raw analytics, do the rawanalytics computation via MongoDB database, and produce results based on predefined configs.
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 a pull request may close this issue.

1 participant