{"action":"created","comment":{"url":"https://api.github.com/repos/windup/windup/pulls/comments/86390032","pull_request_review_id":7051824,"id":86390032,"diff_hunk":"@@ -0,0 +1,195 @@\n+package org.jboss.windup.rules.apps.javaee.model.stats;\n+\n+import org.jboss.windup.graph.GraphContext;\n+import org.jboss.windup.graph.service.GraphService;\n+\n+import com.tinkerpop.frames.FramedGraphQuery;\n+import java.util.Date;\n+import java.util.HashMap;\n+import java.util.Map;\n+import java.util.logging.Logger;\n+import java.util.stream.Collectors;\n+import org.apache.commons.collections4.CollectionUtils;\n+import org.apache.commons.lang3.StringUtils;\n+import org.jboss.windup.graph.frames.TypeAwareFramedGraphQuery;\n+import org.jboss.windup.graph.model.WindupVertexFrame;\n+import org.jboss.windup.graph.model.resource.FileModel;\n+import org.jboss.windup.rules.apps.java.model.JarArchiveModel;\n+import org.jboss.windup.rules.apps.java.model.JavaClassModel;\n+import org.jboss.windup.rules.apps.javaee.model.EjbBeanBaseModel;\n+import org.jboss.windup.rules.apps.javaee.model.EjbEntityBeanModel;\n+import org.jboss.windup.rules.apps.javaee.model.EjbMessageDrivenModel;\n+import org.jboss.windup.rules.apps.javaee.model.EjbSessionBeanModel;\n+import org.jboss.windup.rules.apps.javaee.model.JPANamedQueryModel;\n+import org.jboss.windup.rules.apps.javaee.model.JPAPersistenceUnitModel;\n+import org.jboss.windup.rules.apps.javaee.model.JaxRSWebServiceModel;\n+import org.jboss.windup.rules.apps.javaee.model.JaxWSWebServiceModel;\n+import org.jboss.windup.rules.apps.javaee.model.JmsConnectionFactoryModel;\n+import org.jboss.windup.rules.apps.javaee.model.JmsDestinationModel;\n+import org.jboss.windup.rules.apps.javaee.model.JmsDestinationType;\n+import org.jboss.windup.util.Logging;\n+\n+/**\n+ * Functionality for the Technologies Report.\n+ * \n+ * @author <a href=\"mailto:zizka@seznam.cz\">Ondrej Zizka</a>\n+ */\n+public class TechnologiesStatsService extends GraphService<TechnologiesStatsModel>\n+{\n+    private final static Logger LOG = Logging.get(TechnologiesStatsService.class);\n+    \n+    public TechnologiesStatsService(GraphContext context)\n+    {\n+        super(context, TechnologiesStatsModel.class);\n+    }\n+\n+    /**\n+     * Compute the stats for this execution.\n+     */\n+    public TechnologiesStatsModel computeStats()\n+    {\n+        TechnologiesStatsModel stats = this.create();\n+        stats.setComputed(new Date());\n+        /*\n+        stats.setFilesStats(new HashMap<String, GeneralStatsItemModel>(){{\n+            put(\"foo\", item(123));\n+            put(\"bar\", item(234));\n+        }});*/\n+        \n+        // Files type share\n+        Map<String, Integer> suffixToCount = countFilesBySuffix();\n+        Map<String, Integer> fileTypeShares = countFilesShareBySuffix(suffixToCount);\n+        \n+        stats.setStatsFilesByTypeJavaPercent(item(fileTypeShares.getOrDefault(\"class\", 0) + fileTypeShares.getOrDefault(\"java\", 0)));\n+        stats.setStatsFilesByTypeJsPercent(item(fileTypeShares.getOrDefault(\"js\", 0)));\n+        stats.setStatsFilesByTypeHtmlPercent(item(fileTypeShares.getOrDefault(\"html\", 0)));\n+        stats.setStatsFilesByTypeCssPercent(item(fileTypeShares.getOrDefault(\"css\", 0)));\n+        stats.setStatsFilesByTypeXmlPercent(item(fileTypeShares.getOrDefault(\"xml\", 0)));\n+        stats.setStatsFilesByTypeFmtPercent(item(fileTypeShares.getOrDefault(\"fmt\", 0)));\n+        \n+        \n+        // Amounts\n+        // For the commented, we don't have a graph representation.\n+        stats.setStatsServicesEjbStateless(item(countByType(EjbSessionBeanModel.class, EjbBeanBaseModel.SESSION_TYPE, \"stateless\")));\n+        //stats.setStatsServicesEjbStateless(item(\"A\", \"B\", EjbBeanBaseModel.class, null)); /// Works\n+        stats.setStatsServicesEjbStateful(item(countByType(EjbSessionBeanModel.class,  EjbBeanBaseModel.SESSION_TYPE, \"stateful\")));\n+        stats.setStatsServicesEjbMessageDriven(item(countByType(EjbMessageDrivenModel.class)));\n+        \n+        stats.setStatsServicesJpaEntitites(item(countByType(EjbEntityBeanModel.class)));\n+        stats.setStatsServicesJpaNamedQueries(item(countByType(JPANamedQueryModel.class)));\n+        stats.setStatsServicesJpaPersistenceUnits(item(countByType(JPAPersistenceUnitModel.class)));\n+        //stats.setStatsServicesRmiServices(item(countByType(.class)));\n+        \n+        //stats.setStatsServerResourcesDbJdbcDatasources(item(countByType(.class)));\n+        //stats.setStatsServerResourcesDbXaJdbcDatasources(item(countByType(.class)));\n+        \n+        stats.setStatsServicesHttpJaxRs(item(countByType(JaxRSWebServiceModel.class)));\n+        stats.setStatsServicesHttpJaxWs(item(countByType(JaxWSWebServiceModel.class)));\n+        \n+        stats.setStatsServerResourcesMsgJmsQueues(item(countByType(JmsDestinationModel.class, JmsDestinationModel.DESTINATION_TYPE, JmsDestinationType.QUEUE.name())));\n+        stats.setStatsServerResourcesMsgJmsTopics(item(countByType(JmsDestinationModel.class, JmsDestinationModel.DESTINATION_TYPE, JmsDestinationType.TOPIC.name())));\n+        stats.setStatsServerResourcesMsgJmsConnectionFactories(item(countByType(JmsConnectionFactoryModel.class)));\n+        \n+        //stats.setStatsServerResourcesSecurityRealms(item(countByType(.class)));\n+        //stats.setStatsServerResourcesJndiTotalEntries(item(countByType(.class)));","path":"rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/model/stats/TechnologiesStatsService.java","position":94,"original_position":94,"commit_id":"10535612c740bda8ebdc66f5b306d8a5d3af35ec","original_commit_id":"df6eabeabdbac05f753072d8bf41012875b3e653","user":{"login":"OndraZizka","id":644904,"avatar_url":"https://avatars.githubusercontent.com/u/644904?v=3","gravatar_id":"","url":"https://api.github.com/users/OndraZizka","html_url":"https://github.com/OndraZizka","followers_url":"https://api.github.com/users/OndraZizka/followers","following_url":"https://api.github.com/users/OndraZizka/following{/other_user}","gists_url":"https://api.github.com/users/OndraZizka/gists{/gist_id}","starred_url":"https://api.github.com/users/OndraZizka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndraZizka/subscriptions","organizations_url":"https://api.github.com/users/OndraZizka/orgs","repos_url":"https://api.github.com/users/OndraZizka/repos","events_url":"https://api.github.com/users/OndraZizka/events{/privacy}","received_events_url":"https://api.github.com/users/OndraZizka/received_events","type":"User","site_admin":false},"body":"DONE","created_at":"2016-11-03T16:48:58Z","updated_at":"2016-11-03T16:48:58Z","html_url":"https://github.com/windup/windup/pull/1030#discussion_r86390032","pull_request_url":"https://api.github.com/repos/windup/windup/pulls/1030","_links":{"self":{"href":"https://api.github.com/repos/windup/windup/pulls/comments/86390032"},"html":{"href":"https://github.com/windup/windup/pull/1030#discussion_r86390032"},"pull_request":{"href":"https://api.github.com/repos/windup/windup/pulls/1030"}}},"pull_request":{"url":"https://api.github.com/repos/windup/windup/pulls/1030","id":91194347,"html_url":"https://github.com/windup/windup/pull/1030","diff_url":"https://github.com/windup/windup/pull/1030.diff","patch_url":"https://github.com/windup/windup/pull/1030.patch","issue_url":"https://api.github.com/repos/windup/windup/issues/1030","number":1030,"state":"open","locked":false,"title":"#290 Tech Report - #299 #319 #329 #328","user":{"login":"OndraZizka","id":644904,"avatar_url":"https://avatars.githubusercontent.com/u/644904?v=3","gravatar_id":"","url":"https://api.github.com/users/OndraZizka","html_url":"https://github.com/OndraZizka","followers_url":"https://api.github.com/users/OndraZizka/followers","following_url":"https://api.github.com/users/OndraZizka/following{/other_user}","gists_url":"https://api.github.com/users/OndraZizka/gists{/gist_id}","starred_url":"https://api.github.com/users/OndraZizka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndraZizka/subscriptions","organizations_url":"https://api.github.com/users/OndraZizka/orgs","repos_url":"https://api.github.com/users/OndraZizka/repos","events_url":"https://api.github.com/users/OndraZizka/events{/privacy}","received_events_url":"https://api.github.com/users/OndraZizka/received_events","type":"User","site_admin":false},"body":"Squash before merging please.\nThis either needs https://github.com/windup/windup-web/pull/64 and Task #333\nOR PR 64 minus commit b716876609\n","created_at":"2016-10-27T12:51:50Z","updated_at":"2016-11-03T16:48:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"adcbe2cb80954e7f38e8109bd6da4f20180f1d1a","assignee":{"login":"jsight","id":1181549,"avatar_url":"https://avatars.githubusercontent.com/u/1181549?v=3","gravatar_id":"","url":"https://api.github.com/users/jsight","html_url":"https://github.com/jsight","followers_url":"https://api.github.com/users/jsight/followers","following_url":"https://api.github.com/users/jsight/following{/other_user}","gists_url":"https://api.github.com/users/jsight/gists{/gist_id}","starred_url":"https://api.github.com/users/jsight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsight/subscriptions","organizations_url":"https://api.github.com/users/jsight/orgs","repos_url":"https://api.github.com/users/jsight/repos","events_url":"https://api.github.com/users/jsight/events{/privacy}","received_events_url":"https://api.github.com/users/jsight/received_events","type":"User","site_admin":false},"assignees":[{"login":"jsight","id":1181549,"avatar_url":"https://avatars.githubusercontent.com/u/1181549?v=3","gravatar_id":"","url":"https://api.github.com/users/jsight","html_url":"https://github.com/jsight","followers_url":"https://api.github.com/users/jsight/followers","following_url":"https://api.github.com/users/jsight/following{/other_user}","gists_url":"https://api.github.com/users/jsight/gists{/gist_id}","starred_url":"https://api.github.com/users/jsight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsight/subscriptions","organizations_url":"https://api.github.com/users/jsight/orgs","repos_url":"https://api.github.com/users/jsight/repos","events_url":"https://api.github.com/users/jsight/events{/privacy}","received_events_url":"https://api.github.com/users/jsight/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/windup/windup/pulls/1030/commits","review_comments_url":"https://api.github.com/repos/windup/windup/pulls/1030/comments","review_comment_url":"https://api.github.com/repos/windup/windup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/windup/windup/issues/1030/comments","statuses_url":"https://api.github.com/repos/windup/windup/statuses/10535612c740bda8ebdc66f5b306d8a5d3af35ec","head":{"label":"OndraZizka:techReport","ref":"techReport","sha":"10535612c740bda8ebdc66f5b306d8a5d3af35ec","user":{"login":"OndraZizka","id":644904,"avatar_url":"https://avatars.githubusercontent.com/u/644904?v=3","gravatar_id":"","url":"https://api.github.com/users/OndraZizka","html_url":"https://github.com/OndraZizka","followers_url":"https://api.github.com/users/OndraZizka/followers","following_url":"https://api.github.com/users/OndraZizka/following{/other_user}","gists_url":"https://api.github.com/users/OndraZizka/gists{/gist_id}","starred_url":"https://api.github.com/users/OndraZizka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndraZizka/subscriptions","organizations_url":"https://api.github.com/users/OndraZizka/orgs","repos_url":"https://api.github.com/users/OndraZizka/repos","events_url":"https://api.github.com/users/OndraZizka/events{/privacy}","received_events_url":"https://api.github.com/users/OndraZizka/received_events","type":"User","site_admin":false},"repo":{"id":10457496,"name":"windup","full_name":"OndraZizka/windup","owner":{"login":"OndraZizka","id":644904,"avatar_url":"https://avatars.githubusercontent.com/u/644904?v=3","gravatar_id":"","url":"https://api.github.com/users/OndraZizka","html_url":"https://github.com/OndraZizka","followers_url":"https://api.github.com/users/OndraZizka/followers","following_url":"https://api.github.com/users/OndraZizka/following{/other_user}","gists_url":"https://api.github.com/users/OndraZizka/gists{/gist_id}","starred_url":"https://api.github.com/users/OndraZizka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndraZizka/subscriptions","organizations_url":"https://api.github.com/users/OndraZizka/orgs","repos_url":"https://api.github.com/users/OndraZizka/repos","events_url":"https://api.github.com/users/OndraZizka/events{/privacy}","received_events_url":"https://api.github.com/users/OndraZizka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OndraZizka/windup","description":"Windup","fork":true,"url":"https://api.github.com/repos/OndraZizka/windup","forks_url":"https://api.github.com/repos/OndraZizka/windup/forks","keys_url":"https://api.github.com/repos/OndraZizka/windup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OndraZizka/windup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OndraZizka/windup/teams","hooks_url":"https://api.github.com/repos/OndraZizka/windup/hooks","issue_events_url":"https://api.github.com/repos/OndraZizka/windup/issues/events{/number}","events_url":"https://api.github.com/repos/OndraZizka/windup/events","assignees_url":"https://api.github.com/repos/OndraZizka/windup/assignees{/user}","branches_url":"https://api.github.com/repos/OndraZizka/windup/branches{/branch}","tags_url":"https://api.github.com/repos/OndraZizka/windup/tags","blobs_url":"https://api.github.com/repos/OndraZizka/windup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OndraZizka/windup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OndraZizka/windup/git/refs{/sha}","trees_url":"https://api.github.com/repos/OndraZizka/windup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OndraZizka/windup/statuses/{sha}","languages_url":"https://api.github.com/repos/OndraZizka/windup/languages","stargazers_url":"https://api.github.com/repos/OndraZizka/windup/stargazers","contributors_url":"https://api.github.com/repos/OndraZizka/windup/contributors","subscribers_url":"https://api.github.com/repos/OndraZizka/windup/subscribers","subscription_url":"https://api.github.com/repos/OndraZizka/windup/subscription","commits_url":"https://api.github.com/repos/OndraZizka/windup/commits{/sha}","git_commits_url":"https://api.github.com/repos/OndraZizka/windup/git/commits{/sha}","comments_url":"https://api.github.com/repos/OndraZizka/windup/comments{/number}","issue_comment_url":"https://api.github.com/repos/OndraZizka/windup/issues/comments{/number}","contents_url":"https://api.github.com/repos/OndraZizka/windup/contents/{+path}","compare_url":"https://api.github.com/repos/OndraZizka/windup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OndraZizka/windup/merges","archive_url":"https://api.github.com/repos/OndraZizka/windup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OndraZizka/windup/downloads","issues_url":"https://api.github.com/repos/OndraZizka/windup/issues{/number}","pulls_url":"https://api.github.com/repos/OndraZizka/windup/pulls{/number}","milestones_url":"https://api.github.com/repos/OndraZizka/windup/milestones{/number}","notifications_url":"https://api.github.com/repos/OndraZizka/windup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OndraZizka/windup/labels{/name}","releases_url":"https://api.github.com/repos/OndraZizka/windup/releases{/id}","deployments_url":"https://api.github.com/repos/OndraZizka/windup/deployments","created_at":"2013-06-03T15:17:47Z","updated_at":"2015-04-02T03:35:12Z","pushed_at":"2016-11-03T15:10:27Z","git_url":"git://github.com/OndraZizka/windup.git","ssh_url":"git@github.com:OndraZizka/windup.git","clone_url":"https://github.com/OndraZizka/windup.git","svn_url":"https://github.com/OndraZizka/windup","homepage":null,"size":48725,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"windup:master","ref":"master","sha":"5660be141219e5976746838dac95c480c5fb177f","user":{"login":"windup","id":4266383,"avatar_url":"https://avatars.githubusercontent.com/u/4266383?v=3","gravatar_id":"","url":"https://api.github.com/users/windup","html_url":"https://github.com/windup","followers_url":"https://api.github.com/users/windup/followers","following_url":"https://api.github.com/users/windup/following{/other_user}","gists_url":"https://api.github.com/users/windup/gists{/gist_id}","starred_url":"https://api.github.com/users/windup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/windup/subscriptions","organizations_url":"https://api.github.com/users/windup/orgs","repos_url":"https://api.github.com/users/windup/repos","events_url":"https://api.github.com/users/windup/events{/privacy}","received_events_url":"https://api.github.com/users/windup/received_events","type":"Organization","site_admin":false},"repo":{"id":9702026,"name":"windup","full_name":"windup/windup","owner":{"login":"windup","id":4266383,"avatar_url":"https://avatars.githubusercontent.com/u/4266383?v=3","gravatar_id":"","url":"https://api.github.com/users/windup","html_url":"https://github.com/windup","followers_url":"https://api.github.com/users/windup/followers","following_url":"https://api.github.com/users/windup/following{/other_user}","gists_url":"https://api.github.com/users/windup/gists{/gist_id}","starred_url":"https://api.github.com/users/windup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/windup/subscriptions","organizations_url":"https://api.github.com/users/windup/orgs","repos_url":"https://api.github.com/users/windup/repos","events_url":"https://api.github.com/users/windup/events{/privacy}","received_events_url":"https://api.github.com/users/windup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/windup/windup","description":"Windup - JBoss Automated Migration Tool","fork":false,"url":"https://api.github.com/repos/windup/windup","forks_url":"https://api.github.com/repos/windup/windup/forks","keys_url":"https://api.github.com/repos/windup/windup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/windup/windup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/windup/windup/teams","hooks_url":"https://api.github.com/repos/windup/windup/hooks","issue_events_url":"https://api.github.com/repos/windup/windup/issues/events{/number}","events_url":"https://api.github.com/repos/windup/windup/events","assignees_url":"https://api.github.com/repos/windup/windup/assignees{/user}","branches_url":"https://api.github.com/repos/windup/windup/branches{/branch}","tags_url":"https://api.github.com/repos/windup/windup/tags","blobs_url":"https://api.github.com/repos/windup/windup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/windup/windup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/windup/windup/git/refs{/sha}","trees_url":"https://api.github.com/repos/windup/windup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/windup/windup/statuses/{sha}","languages_url":"https://api.github.com/repos/windup/windup/languages","stargazers_url":"https://api.github.com/repos/windup/windup/stargazers","contributors_url":"https://api.github.com/repos/windup/windup/contributors","subscribers_url":"https://api.github.com/repos/windup/windup/subscribers","subscription_url":"https://api.github.com/repos/windup/windup/subscription","commits_url":"https://api.github.com/repos/windup/windup/commits{/sha}","git_commits_url":"https://api.github.com/repos/windup/windup/git/commits{/sha}","comments_url":"https://api.github.com/repos/windup/windup/comments{/number}","issue_comment_url":"https://api.github.com/repos/windup/windup/issues/comments{/number}","contents_url":"https://api.github.com/repos/windup/windup/contents/{+path}","compare_url":"https://api.github.com/repos/windup/windup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/windup/windup/merges","archive_url":"https://api.github.com/repos/windup/windup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/windup/windup/downloads","issues_url":"https://api.github.com/repos/windup/windup/issues{/number}","pulls_url":"https://api.github.com/repos/windup/windup/pulls{/number}","milestones_url":"https://api.github.com/repos/windup/windup/milestones{/number}","notifications_url":"https://api.github.com/repos/windup/windup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/windup/windup/labels{/name}","releases_url":"https://api.github.com/repos/windup/windup/releases{/id}","deployments_url":"https://api.github.com/repos/windup/windup/deployments","created_at":"2013-04-26T18:52:08Z","updated_at":"2016-10-31T19:18:10Z","pushed_at":"2016-11-03T15:10:28Z","git_url":"git://github.com/windup/windup.git","ssh_url":"git@github.com:windup/windup.git","clone_url":"https://github.com/windup/windup.git","svn_url":"https://github.com/windup/windup","homepage":"","size":131692,"stargazers_count":61,"watchers_count":61,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":81,"mirror_url":null,"open_issues_count":41,"forks":81,"open_issues":41,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/windup/windup/pulls/1030"},"html":{"href":"https://github.com/windup/windup/pull/1030"},"issue":{"href":"https://api.github.com/repos/windup/windup/issues/1030"},"comments":{"href":"https://api.github.com/repos/windup/windup/issues/1030/comments"},"review_comments":{"href":"https://api.github.com/repos/windup/windup/pulls/1030/comments"},"review_comment":{"href":"https://api.github.com/repos/windup/windup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/windup/windup/pulls/1030/commits"},"statuses":{"href":"https://api.github.com/repos/windup/windup/statuses/10535612c740bda8ebdc66f5b306d8a5d3af35ec"}}}}
{"actor":{"display_login":"OndraZizka"}}