innogames / ltc

Online web application-dashboard for report analyzing,running and online monitoring of load tests started with JMeter
MIT License
197 stars 96 forks source link

Getting"ImportError: No module named xmlrpc" while setting up the tool #10

Closed khatmodeniraj closed 6 years ago

khatmodeniraj commented 6 years ago

Hi,

I am setting up tool on Windows 10 and followed all the steps which you have mentioned. But i am getting"ImportError: No module named xmlrpc" when i execute manage.py makemigrations. I looked over the net and came across one post which says "The answer is that the module xmlrpc is part of python3, not python2.x".

Requirement txt says use python=2.7 and it doesn't contain anything related to xmlrpc . Kindly let me know in case i am not not following correct steps.

v0devil commented 6 years ago

Hi,

Thanks for the issue. You are right and info in readme was outdated regarding python=2.7. Currently it mostly compatible with py3.

v0devil commented 6 years ago

to run it with py2.7 you can try to replace code in /analyzer/confluence/confluenceposter.py with

import xmlrpclib
import logging as log

WIKI_URL = None
WIKI_USER = None
WIKI_PASSWORD = None
WIKI_SPACE = None
WIKI_ALL_PAGE = None

class ConfluenceError(Exception):
        pass

class ConfluencePoster(object):
        def __init__(self, base_url, username, password):
                self._client = xmlrpclib.ServerProxy(base_url + '/rpc/xmlrpc')
                self._username = username
                self._password = password

        def login(self):
                try:
                        self._token = self._client.confluence2.login(
                                self._username, self._password)
                except xmlrpclib.Fault as e:
                        if 'AuthenticationFailedException' in e.faultString:
                                raise ConfluenceError('Confluence login failed.')

        def logout(self):
                self._client.confluence2.logout(self._token)

        def move_page(self, child, parent, dest='append'):
                self._client.confluence2.movePage(
                        self._token, child['id'], parent['id'], dest)

        def get_page(self, space, page_name):
                return self._client.confluence2.getPage(self._token, space, page_name)

        def get_children(self, pageid):
                return self._client.confluence2.getChildren(self._token, pageid)

        def post_page(self, page):
                self._client.confluence2.storePage(self._token, page)

        def prepend_page(self, space, page_name, xhtml):
                page = self.get_page(space, page_name)
                page['content'] = page['content'] + xhtml
                self.post_page(page)

        def prepend_page_max_entries(self, space, page_name, xhtml, max_entries,
                                                                 separator):
                page = self.get_page(space, page_name)

                pos = 0
                separator_len = len(separator)
                remaining_entries = max_entries - 1
                while remaining_entries > 0:
                        pos = page['content'].find(separator, pos)
                        if pos == -1:
                                break
                        pos += separator_len
                        remaining_entries -= 1
                else:
                        page['content'] = page['content'][:pos]

                page['content'] = xhtml + page['content']
                self.post_page(page)

        def watchpage(self, page, user):
                try:
                        self._client.confluence2.watchPageForUser(
                                self._token, page['id'], user)
                except:
                        log.warning('can not add user {}'.format(user))
                        # raven_client.captureException()
                        pass

        def get_watcher(self, page):
                # returns list of dictionarys
                watcher_list = self._client.confluence2.getWatchersForPage(
                        self._token, page['id'])
                return [watcher['name'] for watcher in watcher_list]
khatmodeniraj commented 6 years ago

Thanks for the details. I have following questions, can you please answer?

  1. I am using Windows 10 for setting up complete application. I hope we can setup everything on windows. Both Application and DB.
  2. I am using latest python version 3.7.0, will application work on this version?
  3. Requirement.txt shows following binaries and their version details, these are old version. WIll application work on latest versions of following binaries? Django==1.10.5 matplotlib==1.4.3 numpy==1.13.1+mkl pandas==0.17.0 paramiko==2.4.1 psutil==5.2.1 matplotlib==1.4.3 scipy==0.19.1 SQLAlchemy==1.1.3
v0devil commented 6 years ago

Requirements are showing minimal versions, it must work with newer. One thing I am not sure about is Django, could be problems with 2.0+ (but it works with 1.11)

khatmodeniraj commented 6 years ago

I am able to setup everything on windows. Application is up and running.
When i tried to upload file but getting error "Object of type int32 is not JSON serializable"

I did some research around and came across following in Stackoverflow https://stackoverflow.com/questions/11942364/typeerror-integer-is-not-json-serializable-when-serializing-json-in-python

Can you please let me if you have any work around?

image

v0devil commented 6 years ago

Can you plz give a part of information you try to upload

khatmodeniraj commented 6 years ago

Please take a look at attached file. Sent you as txt as CSV is not allowed to upload.

upload.txt

v0devil commented 6 years ago

I ll take a look

v0devil commented 6 years ago

In first column you have data in exponential form (1.54E+12) probably due wrong save in Excel. Just set a proper data type and re-save again.

khatmodeniraj commented 6 years ago

Thanks for taking a look. I tried again as you have mentioned with data in first column ... still got the same error. "Object of type int32 is not JSON serializable". i have attached new file. Can you please take a look?

newfile.txt

If you have any working sample file, can you please share so i can take a look at my setup as well?

v0devil commented 6 years ago

Fixed in https://github.com/innogames/JMeter-Control-Center/commit/538e0be30677738415013ef7661df5e166bd83e7

Please pull changes and try again

khatmodeniraj commented 6 years ago

Awesome it worked. Thanks for fixing issue. I have started us Just one question: Can we get comparison table report between test1 and test2?

Few questions:

  1. Insted of graph is it possible to get comparative report in tabular format? Why am i asking this .. because i tried data_example which you have provided. I made changes in few response_times same sheet and uploaded as run 2. But graphical data is not readable. I can understand as due to many urls input files, graph might have distorted. Added screen shot below with result files .. image run1.txt run2.txt

  2. Positive and Negative should show some data... am i right? PFA screen shot below for reference. image

Thanks once again for helping to get it running.

v0devil commented 6 years ago

Regarding comparison in tabular form.. this thing is somehow disappeared, lemme implement it again or resurrect. The positive/negative views are showing something if data got statistically significant change. So, this means if to change some small piece of data it could be ignored or so

v0devil commented 6 years ago

As a fast solution here is the comparison table: https://github.com/innogames/JMeter-Control-Center/commit/5f1f8045d40bd72534af232f627a6e9f62ca3d2d Could be improved of course afterwards, just tell me how it should look like :) Pull again please

khatmodeniraj commented 6 years ago

Thanks once again :) I was able to get difference. Attaching screen shot for the same.

image