Browse Source

Remove django-stripped test

INADA Naoki 12 years ago
parent
commit
cd3d83a9f3

+ 0 - 38
django-stripped/README.md

@@ -1,38 +0,0 @@
-# Django Benchmarking Test
-
-This is the Django portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
-
-### JSON Encoding Test
-
-* [JSON test source](hello/world/views.py)
-
-
-### Data-Store/Database Mapping Test
-
-* [DB test controller](hello/world/views.py)
-* [DB test model](hello/world/models.py)
-
-
-## Infrastructure Software Versions
-The tests were run with:
-* [Python 2.7.3](http://www.python.org/)
-* [Django 1.4](https://www.djangoproject.com/)
-* [Gunicorn 0.17.2](http://gunicorn.org/)
-* [MySQL 5.5.29](https://dev.mysql.com/)
-
-
-## Resources
-* https://docs.djangoproject.com/en/dev/intro/tutorial01/
-
-## Test URLs
-### JSON Encoding Test
-
-http://localhost:8080/json
-
-### Data-Store/Database Mapping Test
-
-http://localhost:8080/db
-
-### Variable Query Test
-
-http://localhost:8080/db?queries=2

+ 0 - 0
django-stripped/__init__.py


+ 0 - 21
django-stripped/benchmark_config

@@ -1,21 +0,0 @@
-{
-  "framework": "django-stripped",
-  "tests": [{
-    "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/db?queries=",
-      "port": 8080,
-      "sort": 33
-    },
-    "py3": {
-      "setup_file": "setup_py3",
-      "json_url": "/json",
-      "db_url": "/db",
-      "query_url": "/db?queries=",
-      "port": 8080,
-      "sort": 243
-    }
-  }]
-}

+ 0 - 0
django-stripped/hello/hello/__init__.py


+ 0 - 173
django-stripped/hello/hello/settings.py

@@ -1,173 +0,0 @@
-# Django settings for hello project.
-
-DEBUG = False
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
-    # ('Your Name', '[email protected]'),
-)
-
-MANAGERS = ADMINS
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': 'hello_world',                      # Or path to database file if using sqlite3.
-        'USER': 'benchmarkdbuser',                      # Not used with sqlite3.
-        'PASSWORD': 'benchmarkdbpass',                  # Not used with sqlite3.
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
-        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
-        'CONN_MAX_AGE': 30,
-    }
-}
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be available on all operating systems.
-# On Unix systems, a value of None will cause Django to use the same
-# timezone as the operating system.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Chicago'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en-us'
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale.
-USE_L10N = True
-
-# If you set this to False, Django will not use timezone-aware datetimes.
-USE_TZ = True
-
-# Absolute filesystem path to the directory that will hold user-uploaded files.
-# Example: "/home/media/media.lawrence.com/media/"
-MEDIA_ROOT = ''
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash.
-# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
-MEDIA_URL = ''
-
-# Absolute path to the directory static files should be collected to.
-# Don't put anything in this directory yourself; store your static files
-# in apps' "static/" subdirectories and in STATICFILES_DIRS.
-# Example: "/home/media/media.lawrence.com/static/"
-STATIC_ROOT = ''
-
-# URL prefix for static files.
-# Example: "http://media.lawrence.com/static/"
-STATIC_URL = '/static/'
-
-# Additional locations of static files
-STATICFILES_DIRS = (
-    # Put strings here, like "/home/html/static" or "C:/www/django/static".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
-)
-
-# List of finder classes that know how to find static files in
-# various locations.
-STATICFILES_FINDERS = (
-    'django.contrib.staticfiles.finders.FileSystemFinder',
-    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
-#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
-)
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = '_7mb6#v4yf@qhc(r(zbyh&z_iby-na*7wz&-v6pohsul-d#y5f'
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    ('django.template.loaders.cached.Loader', (
-        'django.template.loaders.filesystem.Loader',
-        'django.template.loaders.app_directories.Loader',
-    )),
-)
-
-MIDDLEWARE_CLASSES = (
-    # In our optimized version, we can remove this middleware that we're not using
-    # 'django.middleware.common.CommonMiddleware',
-    # 'django.contrib.sessions.middleware.SessionMiddleware',
-    # 'django.middleware.csrf.CsrfViewMiddleware',
-    # 'django.contrib.auth.middleware.AuthenticationMiddleware',
-    # 'django.contrib.messages.middleware.MessageMiddleware',
-)
-
-ROOT_URLCONF = 'hello.urls'
-
-# Python dotted path to the WSGI application used by Django's runserver.
-WSGI_APPLICATION = 'hello.wsgi.application'
-
-TEMPLATE_DIRS = (
-    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
-    "/home/ubuntu/FrameworkBenchmarks/django/hello/templates",
-)
-
-INSTALLED_APPS = (
-    # Removing these for our optimized version
-    # 'django.contrib.auth',
-    # 'django.contrib.contenttypes',
-    # 'django.contrib.sessions',
-    # 'django.contrib.sites',
-    # 'django.contrib.messages',
-    # 'django.contrib.staticfiles',
-    # Uncomment the next line to enable the admin:
-    # 'django.contrib.admin',
-    # Uncomment the next line to enable admin documentation:
-    # 'django.contrib.admindocs',
-    'world',
-)
-
-# A sample logging configuration. The only tangible logging
-# performed by this configuration is to send an email to
-# the site admins on every HTTP 500 error when DEBUG=False.
-# See http://docs.djangoproject.com/en/dev/topics/logging for
-# more details on how to customize your logging configuration.
-LOGGING = {
-    'version': 1,
-    'disable_existing_loggers': True,
-    'formatters': {
-        'verbose': {
-            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
-        },
-        'simple': {
-            'format': '%(levelname)s %(message)s'
-        },
-    },
-    'filters': {
-        'require_debug_false': {
-            '()': 'django.utils.log.RequireDebugFalse'
-        }
-    },
-    'handlers': {
-        'mail_admins': {
-            'level': 'ERROR',
-            'filters': ['require_debug_false'],
-            'class': 'django.utils.log.AdminEmailHandler'
-        },
-        'console':{
-            'level': 'ERROR',
-            'class': 'logging.StreamHandler',
-            'formatter': 'simple'
-        },
-    },
-    'loggers': {
-        'django.request': {
-            'handlers': ['mail_admins', 'console'],
-            'level': 'ERROR',
-            'propagate': True,
-        },
-    }
-}
-
-ALLOWED_HOSTS = ['*']

+ 0 - 19
django-stripped/hello/hello/urls.py

@@ -1,19 +0,0 @@
-from django.conf.urls import patterns, include, url
-
-# Uncomment the next two lines to enable the admin:
-# from django.contrib import admin
-# admin.autodiscover()
-
-urlpatterns = patterns('',
-    # Examples:
-    # url(r'^$', 'hello.views.home', name='home'),
-    # url(r'^hello/', include('hello.foo.urls')),
-
-    # Uncomment the admin/doc line below to enable admin documentation:
-    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
-
-    # Uncomment the next line to enable the admin:
-    # url(r'^admin/', include(admin.site.urls)),
-    url(r'^json$', 'world.views.json'),
-    url(r'^db$', 'world.views.db'),
-)

+ 0 - 28
django-stripped/hello/hello/wsgi.py

@@ -1,28 +0,0 @@
-"""
-WSGI config for hello project.
-
-This module contains the WSGI application used by Django's development server
-and any production WSGI deployments. It should expose a module-level variable
-named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
-this application via the ``WSGI_APPLICATION`` setting.
-
-Usually you will have the standard Django WSGI application here, but it also
-might make sense to replace the whole Django WSGI application with a custom one
-that later delegates to the Django one. For example, you could introduce WSGI
-middleware here, or combine a Django application with an application of another
-framework.
-
-"""
-import os
-
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hello.settings")
-
-# This application object is used by any WSGI server configured to use this
-# file. This includes Django's development server, if the WSGI_APPLICATION
-# setting points here.
-from django.core.wsgi import get_wsgi_application
-application = get_wsgi_application()
-
-# Apply WSGI middleware here.
-# from helloworld.wsgi import HelloWorldApplication
-# application = HelloWorldApplication(application)

+ 0 - 10
django-stripped/hello/manage.py

@@ -1,10 +0,0 @@
-#!/usr/bin/env python
-import os
-import sys
-
-if __name__ == "__main__":
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hello.settings")
-
-    from django.core.management import execute_from_command_line
-
-    execute_from_command_line(sys.argv)

+ 0 - 11
django-stripped/hello/templates/base.html

@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-</head>
-
-<body>
-  <div id="content">
-    {% block content %}{% endblock %}
-  </div>
-</body>
-</html>

+ 0 - 0
django-stripped/hello/world/__init__.py


+ 0 - 9
django-stripped/hello/world/models.py

@@ -1,9 +0,0 @@
-from django.db import models
-
-# Create your models here.
-
-class World(models.Model):
-  randomNumber = models.IntegerField()
-  class Meta:
-    db_table = 'World'
-

+ 0 - 25
django-stripped/hello/world/views.py

@@ -1,25 +0,0 @@
-# Create your views here.
-
-from django.template import Context, loader
-from django.http import HttpResponse
-from django.core import serializers
-from world.models import World
-import ujson
-import random
-
-def json(request):
-  response = {
-    "message": "Hello, World!"
-  }
-  return HttpResponse(ujson.dumps(response), mimetype="application/json")
-
-def db(request):
-  queries = int(request.GET.get('queries', 1))
-  worlds  = []
-
-  for i in range(queries):
-    # get a random row, we know the ids are between 1 and 10000
-    worlds.append(World.objects.get(id=random.randint(1, 10000)))
-
-  return HttpResponse(serializers.serialize("json", worlds), mimetype="application/json")
-

+ 0 - 34
django-stripped/setup.py

@@ -1,34 +0,0 @@
-import subprocess
-import setup_util
-import multiprocessing
-import os
-
-home = os.path.expanduser('~')
-bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
-NCPU = multiprocessing.cpu_count()
-
-proc = None
-
-
-def start(args):
-    global proc
-    setup_util.replace_text("django-stripped/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'")
-    setup_util.replace_text("django-stripped/hello/hello/settings.py", "\/home\/ubuntu",  home)
-    proc = subprocess.Popen([
-        bin_dir + "/gunicorn",
-        "hello.wsgi:application",
-        "-k", "meinheld.gmeinheld.MeinheldWorker",
-        "-b", "0.0.0.0:8080",
-        '-w', str(NCPU*3),
-        "--log-level=critical"],
-        cwd="django-stripped/hello")
-    return 0
-
-def stop():
-    global proc
-    if proc is None:
-        return 0
-    proc.terminate()
-    proc.wait()
-    proc = None
-    return 0

+ 0 - 34
django-stripped/setup_py3.py

@@ -1,34 +0,0 @@
-import subprocess
-import setup_util
-import multiprocessing
-import os
-
-home = os.path.expanduser('~')
-bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py3/bin')
-NCPU = multiprocessing.cpu_count()
-
-proc = None
-
-
-def start(args):
-    global proc
-    setup_util.replace_text("django-stripped/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'")
-    setup_util.replace_text("django-stripped/hello/hello/settings.py", "\/home\/ubuntu",  home)
-    proc = subprocess.Popen([
-        bin_dir + "/gunicorn",
-        "hello.wsgi:application",
-        "-k", "meinheld.gmeinheld.MeinheldWorker",
-        "-b", "0.0.0.0:8080",
-        '-w', str(NCPU*3),
-        "--log-level=critical"],
-        cwd="django-stripped/hello")
-    return 0
-
-def stop():
-    global proc
-    if proc is None:
-        return 0
-    proc.terminate()
-    proc.wait()
-    proc = None
-    return 0