Description
The module connects any Drupal 7 site with drupalmonitor.com. As the name says, Drupalmonitor is a tool to actively monitor Drupal sites. It's not only a "heartbeat" kind of monitoring. It's much more powerful. Using the drupalmonitor connector, the tool can gather data from the drupal site like how many users, nodes, last cron run, page requests, etc. On drupalmonitor.com, the data will be processed and shown in various ways etc.
At the moment, the module is published and available on drupalmonitor.com. There are already about 250 sites using drupalmonitor connector. Now it's time to release the code on d.o. People are constantly asking for that.
Links
Project Page: http://drupal.org/sandbox/lukas.fischer/1398102
Tool: http://www.drupalmonitor.com
Git Instructions: http://drupal.org/project/1398102/git-instructions
Git Repo: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/lukas.fischer/1398102.git drupalmonitor_connector
cd drupalmonitor_connector
Drupal Version: Drupal 7
Notes
- I reviewed the module with coder and made sure that no issue is shown in coder.
- I also did a code review using http://ventral.org/pareview/httpgitdrupalorgsandboxlukasfischer1398102git and fixed all coding standard issues.
- If you have any question or feedback you can contact me on Skype using lukas.fischer.netnode or email lf __AT__ netnode.ch.
- Security was a key when we developed the module. We don't see a critical issue. What could be mention is, that we log to the database on hook_exit to log execution time and PHP_MAX_MEMORY. There is an option in the module configuration to enable/disable database logging e.g. only used during certain times or only in dev.
- We don't use any 3rd party lib. It's pure PHP using a couple of Drupal hooks and of course custom functions.
Review Bonus:
- http://drupal.org/node/1534556#comment-5874514 (long review)
- http://drupal.org/node/1478290#comment-5798134 (long review)
- http://drupal.org/node/1452328#comment-5819028 (quick review)
- http://drupal.org/node/1425060#comment-5819110 (long review)
- http://drupal.org/node/1536854#comment-5913024 (quick review)
- http://drupal.org/node/1535548#comment-5913144 (long feedback)
- http://drupal.org/node/1535574#comment-5918176 (long review)
Comments
Comment #0.0
lukas.fischer commentedclarification
Comment #0.1
lukas.fischer commentedClarification
Comment #0.2
lukas.fischer commentedClarification
Comment #1
patrickd commentedWelcome!
The actual project page is: http://drupal.org/sandbox/lukas.fischer/1398102
Please take a moment to make your project page follow tips for a great project page.
USE AT YOUR OWN RISK!really ? :DIf your module is that evil maybe you should leave it in sandbox ? (or remove this)
Please take a moment to make your README.txt follow the guidelines for in-project documentation.
Drupal 7 installs and uninstall your schemas automatically
You don't have to do that!
The correct commenting head is
Instead of
(I know that's picky)
Always use TRUE and FALSE for boolean values not 1,0
Your using variables -> you got to remove them on hook_uninstall with variable_del()
We do really need more hands in the application queue and highly recommend to get a review bonus so we will(/can) come back to your application sooner.
regards
Comment #1.0
patrickd commentedClarification
Comment #2
lukas.fischer commentedThanks for the review @patrickd. I fully updated readme.txt (hte note was from an early version ;-)) as well as the project page and fixed the coding stuff you mentioned. I also run coder and http://ventral.org/pareview/httpgitdrupalorgsandboxlukasfischer1398102git.
Anything else I need to consider?
Comment #3
patrickd commentedCorrecting title.
Not yet, it'll take some time but we'll do a deeper review soon.
(As said you can speed this up by doing reviews your self)
Comment #3.0
patrickd commentedproject page updated
Comment #4
targoo commentedHi
That's a nice idea !
1 ) drupalmonitor_connector.module
Is there any reason why you call 'drupalmonitor_connector_page_settings' instead of 'drupalmonitor_connector_settings_form' from the menu ?
2 ) drupalmonitor_connector.module
You can add more details in the permission hook (title and description)
example :
3 ) drupalmonitor_connector.module
t() should not contain HTML tags.
http://drupal.org/node/322731
or see below :
Please consider to get a review bonus so we will come back to your application sooner :
http://drupal.org/node/1011698
See also #1410826: [META] Review bonus
Comment #5
lukas.fischer commentedThank you so much for your review @targoo. I think I learnt something new about hook_permission today!
I fixed all your mentioned points.
I checked code with http://ventral.org/pareview/httpgitdrupalorgsandboxlukasfischer1398102git and coder.
Oooh, I also reviewed http://drupal.org/node/1478290#comment-5798134, hope it's worth a bonus!
Comment #6
lukas.fischer commentedI reviewed http://drupal.org/node/1478290#comment-5798134, http://drupal.org/node/1452328#comment-5819028, http://drupal.org/node/1425060#comment-5819110.
How can I get a bonus?
Comment #6.0
lukas.fischer commentedadded review bonus link
Comment #6.1
lukas.fischer commentedadded review bonus links
Comment #7
klausiSee #1410826: [META] Review bonus, just ask which step is unclear.
Comment #8
lukas.fischer commentedI'd love to get feedback.
Thanks!
Comment #9
klausiDon't forget to add the review bonus tag if you have done the reviews of other applications.
Comment #10
lukas.fischer commentedApply for PAReview: review bonus
Added the tag.
Comment #10.0
lukas.fischer commentednew review bonus added
Comment #11
andyg5000Your README.txt states:
Should be:
May be more friendly if it stated:
Comment #12
andyg5000After enabling your module I get:
Notice: Undefined index: module in _field_info_prepare_instance_display() (line 354 of /home/digitalporch/public_html/modules/field/field.info.inc).
I haven't figured out what exactly is causing it, but the message does go away when I disable your module.
Comment #13
andyg5000Please disregard the Undefined index post. I realized that it was related to commerce_price but appeared when enabling/disabling your module. Sorry for the false alarm. Great module/service!
Comment #14
bloke_zero commentedREADME.txt
When installing the module I got slightly lost - what I would have liked to see is
I'd echo andyg5000's comment above about the requirements section!
drupalmonitor_connector.install
Don't think you need this and refers to 6001 - drupal 6 hangover?
drupalmonitor_connector.module
Line 9-13: Any reason why not using
http://api.drupal.org/api/drupal/includes%21module.inc/function/module_l...
Line 57: Could there be more details for the stupid? I wanted to see an automatically generated hash here as 'hash' says to me something MD5 hashed. Perhaps rephrased as "Enter a string that will identify this site correctly to drupalmonitor.com - you will need to enter the identical string there." or something
Comment #15
lukas.fischer commentedFixed read me issues:
@andyg5000 @bloke_zero, I improved the readme. Please also consider that in the section configuration is much more information about how you need to configure drupalmonitor connector.
Comment #16
lukas.fischer commentedI also fixed the hook_update. It's actually not needed.
I also fixed includes:
Include files are now not included globally - just when /drupalmonitor is called. I think this is even a minor performance improvement. Thanks @bloke_zero.
@bloke_zero
- https://www.drupalmonitor.com is on our todo list, but I think it's not relevant in the context of the project submission process.
- More detailed installation infos and even simplifying the process is something we do everyday. We are currently doing a lot of discussions with developers. We don't think that the installation is very hard - maybe for first time drupal users, yes. If you are interested in talking about drupalmonitor and it's usability, I'm very interested to talk with you on Skype. You can contact me via lukas.fischer.netnode on skype.
Comment #17
lukas.fischer commentedI also added hook_enable for better usability and instruction after the module is installed.
Comment #18
luxpaparazzi commentedManual review:
1. Please don't use german names in SQL queries: "SELECT count(*) as anzahl FROM {drupalmonitor_log} WHERE dt > :time_offset" ... the same on other places
2. Use drupal_json_output() instead of "echo json_encode($info);"
3. I don't like the idea of using global vars, it would be better using static and using a function for accessing the variable on demand...
4. "if ($diff < 2147483648) {"
What is 2147483648?? A comment would be nice ...
5. Autotomated review:
There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
--
The response time for a review is now approaching 4 weeks.
Get a review bonus and we will come back to your application sooner.
See: http://drupal.org/node/1410826
You could consider evaluating my own application:
http://drupal.org/node/1302786
Comment #19
schnitzel commentedJust checked a bit the code, some small things:
Coder Review:
inside of
drupalmonitor_connector_settings_form()you use a default value for the variabledrupalmonitor_hash:why? this confuses people because there is already something there and this here:
in
drupalmonitor_connector_page_datadoesn't make sense, this means that you can access the /drupalmonitor callback when no hash is set!you should use this combination:
which will add some checks for JSON problems in PHP and also invokes correctly the exit hooks of all modules.
you should use:
drupal_page_header()better would be also to return 403 HTTP instead of 200.
Please use http://api.drupal.org/api/drupal/modules!system!system.module/function/s... for module settings form, it also make
drupalmonitor_connector_settings_form_submit()obsolete.Please use english words, not german.
wrong documentation, it is now called hook_permission()
As the Doxygen and comment formatting conventions suggest you should use this style for documentation:
Why don't you use the db_select function? http://api.drupal.org/api/drupal/includes%21database%21database.inc/func...
can be replaced with
Typo
I would suggest to move the *.inc files into a subfolder, makes the whole module strukture more clear.
Why do you have a specific setting to enable the logging? If it is not enabled you don't run anything at all. So why not just disable the module via the module form?
Comment #20
schnitzel commentedlooks like we submitted at the same time
Comment #21
luxpaparazzi commentedRemoving : PAReview: review bonus
Setting status
Comment #22
luxpaparazzi commentedwell yes seems so, and apparently we found different issues, interesting :)
Comment #23
luxpaparazzi commentedah ;)
Comment #24
lukas.fischer commented@Schnitzel @luxpaparazzi - thanks for the great feedback!
I fixed all your mentioned points, checked with Coder and http://ventral.org/pareview/httpgitdrupalorgsandboxlukasfischer1398102git.
Comment #25
lukas.fischer commentedPut status to needs review.
Comment #26
lukas.fischer commented@Schnitzel, regarding your question "Why do you have a specific setting to enable the logging? If it is not enabled you don't run anything at all. So why not just disable the module via the module form?". Drupalmonitor Connector not only returns request/performance information. It also returns status information about modules, variables, usercount, nodecount, etc. which is very useful information too. There is a checkbox to disable explicit performance monitoring, which can be a problem on high traffic websites since it will do an insert on every request.
"Why not db_select everywhere?" - We also keep a D6 version up to date. If we work with classic query style, it's easier to keep both versions in sync.
I keep the .inc files in the module root for now. I don't see an issue with that. Maybe there is a specific reason to put it in a subfolder, but I think it's just a question of personal taste.
@luxpaparazzi, I rebuilt the way drupalmonitor is calculating the time. I found http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/timer_r... which is exactly what I need.
Thanks for any additional feedback.
When is the process project application actually done? Who will take the project out of sandbox mode?
Comment #27
abulte commentedHi,
Is there an open source version of the SERVER code that runs on drupalmonitor.com ? That would probably help external contribution.
Comment #28
klausiPlease don't change the category of this project application. Use the issue queue of the project instead.
Comment #29
lukas.fischer commented@Abulte, no there is no open source version. There are a couple of resons for that:
1. It's very complex in terms of different subsystems. We use couchDB, Drupal, MySQL, Synphony2, rrd and other subsystems which is almost impossible to share at the moment.
2. It's in continous development (for a product) and we try to find out what functionality is needed. We don't want to maintain an open source version, since we have a speedy schedule as well as a vision where we want to go. Both is not fully compatible with going "open source".
3. The client is open sources and offers hook_drupalmonitor(). This hook enables to create custom graphs. We want to extend customization using the drupalmonitor connector and drupalmonitor.com in the future.
4. We talk to a lot of clients. Usually they are very happy to "NOT" care about the monitoring service at all.
It's not that we don't want to share the code. But for the moment I think nobody could make meaningful usage of the "server" code since it's specifically optimized for our infrastructure and usage. However, we share a lot of insights about how drupalmonitor works in our www.drupalmonitor.com/blog and http://www.slideshare.net/netnode. Are you interested in something specific? You can get in touch with me on skype lukas.fischer.netnode
Comment #30
lukas.fischer commentedSet category back to task.
Comment #30.0
lukas.fischer commentedReview bonus added
Comment #30.1
lukas.fischer commentedNew review bonus
Comment #31
lukas.fischer commentedI made new reviews (see in initial post) so I apply for a new review bonus. Thanks for helping!
Comment #32
luxpaparazzi commentedi see that your reviews are generally very short, especially the following 3 ... check the quote below
http://drupal.org/node/1511646#comment-5874464
http://drupal.org/node/1452328#comment-5819028
http://drupal.org/node/1536854#comment-5913024
Comment #33
lukas.fischer commented@luxpaparazzi, hmm... I don't want to cheat. I just try my best. Hopefully also short feedbacks are wished and "rewarded". Also I keep going with reviews... ;-)
Comment #34
luxpaparazzi commented> also short feedbacks are wished and "rewarded"
i think every feedback is generally good feedback, but for calling a feedback "review" is probably something different, but i won't argue on this ;)
Comment #34.0
luxpaparazzi commentednew review link added
Comment #35
klausiThanks for your reviews, just make sure that you pick applications that did not get a review in a long time.
manual review:
require_once dirname(__FILE__) . '/mymodule.inc';Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #36
lukas.fischer commented@klausi, thank you for the feedback:
3. Coder does still return an issue saying that I should apply filter_xss or check_plain. I have no clue how to fix this... maybe a coder problem?
7. Actually I don't want to drupal_access_denied(); because when drupalmonitor.com is pinging the site, it should be able to read the structured output "NO ACCESS". Would this be a problem?
Comment #37
schnitzel commentedmhh all these things Klausi mentioned I already mentioned in my review. but @lukas you told us:
Did you really fixxed all of them? Because I still see them??
If you don't actually fix the things, this process will take really long and produces a lot of double work, which is really rare in the application processes....
Comment #38
schnitzel commentedhave you checked the api for drupal_deliver_page?
drupal_deliver_page($page_callback_result, $default_delivery_callback = NULL)With
$default_delivery_callbackyou should be able to return your own text and still using the normal drupal behavior for access deniedComment #39
lukas.fischer commented@Schnitzel,
I replaced it with drupal_json_encode() which was just the drupal wrapper of json_encode which is not drupal_json_output. My mistake...
I missread this in your comment. The link you pasted was screwed up. It's fixed now.
I think this is a point of discussion. I'm not sure if "You should only return data if the drupalmonitor_hash is not empty." really is a sensible problem. I got feedback of users that don't care about securing this data. But - to keep it short. I changed my mind. Now the module creates a security hash on enable and in the config form it's validated to not be empty. Sorry to not point this out for discussion in the comment and just say "I fixed all your mentioned points" (it was late tough).
Investigating on #38 now.
Comment #40
lukas.fischer commented@Schnitzel
#38 works:
I tried to get rid of "header('HTTP/1.1 403 Forbidden');" but I have no clue how to do this the Drupal way.
Comment #41
luxpaparazzi commented@lukas: take a look at http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_...
Comment #42
lukas.fischer commentedI talked about Drupalmonitor.com during DUG Meetup Basel. Here is the presentation: http://www.slideshare.net/netnode/drupalmonitorcom-drupal-user-group-mee.... It might be interesting for some of you.
Comment #42.0
lukas.fischer commentednew review bonus entry added
Comment #43
liezie_d commentedlatest version gives me this error when trying to activate the module.
our DB is MS SQL.
DOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Column, parameter, or variable #1: Cannot specify a column width on data type int.: CREATE TABLE [{drupalmonitor_log}] ( [id] int(15) NOT NULL IDENTITY, [q] nvarchar(250) NOT NULL, [dt] int(11) NOT NULL, [memory] int(15) NOT NULL, [execution_time] int(11) NOT NULL, CONSTRAINT {drupalmonitor_log}_pkey PRIMARY KEY CLUSTERED ([id]) ); Array ( ) in db_create_table() (regel 2688 van C:\inetpub\drupal-7.12\includes\database\database.inc).
Comment #44
lukas.fischer commented@Liezie, yes, current version of Drupalmonitor Connector currently only supports Linux based system and MySQL.
Comment #45
patrickd commentedleave application issues as tasks please
Comment #46
schnitzel commented@lukas
maybe you should not use length on the "int" datatypes, read the doc:
http://drupal.org/node/146939
so you should use size not length
Comment #47
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #48
lukas.fischer commentedI reopen this thread. We'll actively push the connector module to get it on d.o. Currently we provide the module directly on our site and people keep asking why the module is not available on d.o. Please help to get it in.
Comment #48.0
lukas.fischer commentedupdate
Comment #49
lukas.fischer commentedFinally we did fixes and improvements in the code. We also improved documentation, checked the code in Coder and Pareview, cleaned up git repo.
On the service site (drupalmonitor.com) we get a lot of people complaining why the module is not available trough drupal.org (because of drush, etc.). Currently there are about 250 sites connected with drupalmonitor.com and I guess most of them would love to see the module on d.o. Hopefully we can get this module in.
Thanks for your support.
Lukas
Comment #50
lukas.fischer commented#43 & #46, @Schnitzel, length is fixed
#40 no access is solved now by drupal_deliver_page('MENU_ACCESS_DENIED');'
Comment #51
damienmckennaI installed the connector module. Disclaimer: I don't have the correct security hash as I can't log into my a/c on drupalmonitor.com, but that's a different story.
Every time the /drupalmonitor page is loaded it leaves the following error:
This appears to happen because the cached output has already been triggered and the connector module wants to add the HTTP 403 header.
I suggest changing the hook_menu access arguments to use a custom function, rather than doing all of the logic in drupalmonitor_connector_page_data().
Comment #52
damienmckennaNote - my last comment should not preclude the module from consideration, it'd be perfectly fine as a separate issue for the module's issue queue. Once I can log into my drupalmonitor.com account and can get the module connected properly I'll provide a review.
Comment #53
lukas.fischer commented@DamienMcKenna, did you use the lastest version from Drupal GIT Repo?
Comment #54
damienmckenna@lukas: Yes, I did. FYI I have page caching enabled, perhaps that's part of the issue?
Comment #55
brycefisherfleig commentedLucas,
Very cool module/service! I had no problems installing or setting up on my shared hosting account. Rerun the automated testing and uncovered no problems. I also love that you put a link to the issue queue in the README file. Nice touch! Overall, README is very well written. Totally off-topic, but I wonder if we are distantly related...
I've checked through several of the previously raised issues and confirmed that you have implemented change/fixes for #37, #40, #43, and #46. I didn't see other reviewers mention that, so I just wanted confirm.
Major Issue (only 1)
CrawlerI haven't seen any data from my test site show up on the Drupalmonitor.com dashboard page. I've entered my security hash into Drupalmonitor.com, and I've provided a variety of traffic to my test site and refreshed the Drupalmonitor.com dashboard several times over the period of an hour. Is there a way to trigger the crawler? This is my only reservation about accepting this module -- I can't verify it worked with Drupalmonitor.com.
When I visit http://example.com/drupalmonitor?hash= url, I do get a valid JSON response which appears to be correct (though I didn't check in depth), so I'm guessing the above will work once the crawler scrapes my site.
If you can help me address this issue, then I'll review again.
Minor Issues
Possible Security Improvement Set a minimum length or test the strength of the security hash. Since this is a required field on the /drupalmonitor url and configuration page, I don't have a problem with letting this go or be an issue on the issue queue.
Quote Usage Consistency This is a super minor detail, and I'm probably guilty of these inconsistencies myself. However there's mixed use of single/double quote on the same line in drupalmonitor_connector.module lines 56, 66, 162, 226, 240, and possibly in other files. Though I don't really care about this issue, the coding standards on use of quotes state:
Comment #56
brycefisherfleig commentedChanging status...
Comment #57
brycefisherfleig commentedHi Lucas,
I'm moving my minor issues into your sandbox issue queue for further work. Those should not be considered a barrier to full project application IMHO. You've written some beautiful code. Also, given the quality of your code and your active user base, I believe that Drupal is missing out by not having this module on d.o. The code looks good and demonstrates a thorough knowledge of d.o coding standards and apis. Congrats!
Comment #58
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
But that are not application blockers either, so ...
Thanks for your contribution, lukas.fischer!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #59.0
(not verified) commentedInfos updated