Giter Club home page Giter Club logo

screeps-stats's Introduction

Screeps Stats

Screeps Stats Collection is a service that ingests statistics and console data from the Screeps game and saves them in ElasticSearch. This service can be setup on an existing server or can be provisioned using the supplied vagrant file.

Features

  • Full console output is saved in a quickly searchable database.
  • Performance data- such as CPU and Memory usage- is saved and charted over time.
  • Personal market history is pulled from the API without any game code changes.
  • Provided "screepsstats.js" module can be added to game code in order to collect more statistics.
  • Custom statistics can be easily added using screepsstats module.
  • Statistics are buffered, reducing needed API calls and ensuring data isn't lost for minor issues (server restarts, internet issues).
  • Utilizes segments to store data, preventing it from being continually parsed when Memory is loaded.
  • Falls back to Memory when segments are unavailable.

Quick Start with Vagrant

You can run this immediately on your own computer using vagrant.

  1. Install vagrant.
  2. Open terminal to this project.
  3. Copy the configuration file (cp .screeps_settings.dist.yaml .screeps_settings.yaml) and fill it out.
  4. Run vagrant up and wait.
  5. Open your browser to http://172.16.0.2/.

Self Hosting (Ubuntu)

Install

Running the Screps Stats Collector service on a linux server is a little more complicated but far more robust. This is the recommended setup for long term installations.

ElasticSearch can be installed however you wish, but a provisioning script for ElasticSearch and Kibana is provided.

  1. Download - wget $(curl -L -s https://api.github.com/repos/screepers/screeps-stats/releases/latest | grep tarball_url | head -n 1 | cut -d '"' -f 4) -O screepsstats.tgz
  2. Unpack - mkdir screepsstats; tar zxvf screepsstats.tgz -C ./screepsstats --strip 1.
  3. Move - sudo mv screepsstats /opt/screepsstats.
  4. Change Directory - cd /opt/screepsstats
  5. OPTIONAL: Provision ElasticSearch and Kibana sudo ./provisioning/provision.sh.
  6. Configure - cp .screeps_settings.dist.yaml ~screepsstats/.screeps_settings.yaml and then edit.
  7. Build - make
  8. Install - sudo make install

Manage Service

If you are using an operating system with SystemD this service will be installed when you run make install. From there it can be managed with the systemctl tool (systemctl start screepsstats.service).

For servers without systemd the screepsstatsctl service manager has been provided. It takes the commands start, stop, and reset. For security reasons this should be run as root (it will downgrade itself to it's own user).

Enhanced Screeps Stats Collection

By default this service will ingest the console and performance data (cpu and memory size).

With the addition of a client side (in game, javascript) module additional statistics, including custom stats, can be added.

var ScreepsStats = require('screepsstats')
global.Stats = new ScreepsStats()

module.exports.loop = function () {

  // Do code stuff!

  // Run Stats Last.
  Stats.runBuiltinStats()

  // Optional: Move stats from this tick out of memory
  // and into one of the passed segments.
  Stats.manageSegments([50,51,52,53,54])
}

When the stats collection service picks stats up from the server it will erase them, so as long as the service is running only a few ticks worth of data will be stored. If the stats service fails. Stats will be collected for up to 20 ticks, at which point the oldest data will be removed.

It's important for the ScreepsStats class to get assigned to global.Stats, as the stats collection server will use this class to delete ticks that it has finished processing.

Enhanced Console Attributes

This module uses the console attribute system defined in the Screeps Console project. By adding additional tags like severity, group, and tick, developers can sort and filter their console data to drill down into issue.

You can start with the ExampleLogger in that project as a replacement for console.log to immediately take advantage of this.

screeps-stats's People

Contributors

alinanova21 avatar aphistic avatar awryder avatar bastianh avatar cisien avatar feenr avatar jschavey avatar ruemic avatar tedivm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

screeps-stats's Issues

wily64 no longer available

Attempt at fresh "install" yields following error.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/wily64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/wily64'
default: URL: https://atlas.hashicorp.com/ubuntu/wily64
==> default: Adding box 'ubuntu/wily64' (v20160715.0.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/wily64/versions/20160715.0.0/providers/virtualbox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

The requested URL returned error: 404 Not Found

nginx/1.10.3 (Ubuntu) says 502 Bad Gateway on Windows

hmm

installing is not that easy

as disribed on https://github.com/screepers/screeps-stats#quick-start-with-vagrant
at least for Windows 10 with Vagrant 2.0.2

maybe the config for nginx is not right...

C:\tmp\screeps-stats>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/xenial64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/xenial64'
    default: URL: https://vagrantcloud.com/ubuntu/xenial64
==> default: Adding box 'ubuntu/xenial64' (v20180126.0.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/ubuntu/boxes/xenial64/versions/20180126.0.0/providers/virtualbox.box
    default:
==> default: Successfully added box 'ubuntu/xenial64' (v20180126.0.0) for 'virtualbox'!
==> default: Importing base box 'ubuntu/xenial64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/xenial64' is up to date...
==> default: Setting the name of the VM: screeps-stats_default_1518188579540_46121
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:

  https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

  VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

  config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection reset. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Connection aborted. Retrying...
    default: Warning: Connection reset. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 5.0.40
    default: VirtualBox Version: 5.2
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/tmp/screeps-stats
==> default: Running provisioner: shell...
    default: Running: C:/Users/Bela/AppData/Local/Temp/vagrant-shell20180209-10916-1qibg9f.sh
    default: ** Adding Apt Mirrors **
    default: ** Disabling IPv6 **
    default: #disable ipv6
    default: net.ipv6.conf.all.disable_ipv6 = 1
    default: net.ipv6.conf.default.disable_ipv6 = 1
    default: net.ipv6.conf.lo.disable_ipv6 = 1
    default: net.ipv6.conf.all.disable_ipv6 = 1
    default: net.ipv6.conf.default.disable_ipv6 = 1
    default: net.ipv6.conf.lo.disable_ipv6 = 1
    default: ** Upgrade System **
    default: Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
    default: Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
    default: Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
    default: Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
    default: Get:5 http://archive.ubuntu.com/ubuntu xenial/main Sources [868 kB]
    default: Get:6 http://security.ubuntu.com/ubuntu xenial-security/main Sources [108 kB]
    default: Get:7 http://archive.ubuntu.com/ubuntu xenial/restricted Sources [4,808 B]
    default: Get:8 http://archive.ubuntu.com/ubuntu xenial/universe Sources [7,728 kB]
    default: Get:9 http://security.ubuntu.com/ubuntu xenial-security/restricted Sources [2,116 B]
    default: Get:10 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [50.0 kB]
    default: Get:11 http://security.ubuntu.com/ubuntu xenial-security/multiverse Sources [1,516 B]
    default: Get:12 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [436 kB]
    default: Get:13 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [189 kB]
    default: Get:14 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [201 kB]
    default: Get:15 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [102 kB]
    default: Get:16 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3,208 B]
    default: Get:17 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1,408 B]
    default: Get:18 http://archive.ubuntu.com/ubuntu xenial/multiverse Sources [179 kB]
    default: Get:19 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB]
    default: Get:20 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB]
    default: Get:21 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]
    default: Get:22 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]
    default: Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [294 kB]
    default: Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Sources [2,524 B]
    default: Get:25 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [191 kB]
    default: Get:26 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Sources [7,968 B]
    default: Get:27 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [715 kB]
    default: Get:28 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [297 kB]
    default: Get:29 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [582 kB]
    default: Get:30 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [235 kB]
    default: Get:31 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.2 kB]
    default: Get:32 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8,052 B]
    default: Get:33 http://archive.ubuntu.com/ubuntu xenial-backports/main Sources [3,432 B]
    default: Get:34 http://archive.ubuntu.com/ubuntu xenial-backports/universe Sources [4,904 B]
    default: Get:35 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [4,836 B]
    default: Get:36 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [3,220 B]
    default: Get:37 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [6,628 B]
    default: Get:38 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [3,768 B]
    default: Fetched 24.7 MB in 14s (1,697 kB/s)
    default: Reading package lists...
    default: Reading package lists...
    default: Building dependency tree...
    default:
    default: Reading state information...
    default: Calculating upgrade...
    default: The following packages will be upgraded:
    default:   apparmor cloud-guest-utils grub-common grub-pc grub-pc-bin grub2-common
    default:   libapparmor-perl libapparmor1 libpam-systemd libparted2 libsystemd0 libudev1
    default:   parted sosreport systemd systemd-sysv udev
    default: 17 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    default: Need to get 9,123 kB of archives.
    default: After this operation, 94.2 kB of additional disk space will be used.
    default: Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 systemd-sysv amd64 229-4ubuntu21.1 [12.2 kB]
    default: Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpam-systemd amd64 229-4ubuntu21.1 [116 kB]
    default: Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsystemd0 amd64 229-4ubuntu21.1 [205 kB]
    default: Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 systemd amd64 229-4ubuntu21.1 [3,634 kB]
    default: Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 udev amd64 229-4ubuntu21.1 [992 kB]
    default: Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libudev1 amd64 229-4ubuntu21.1 [54.9 kB]
    default: Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapparmor1 amd64 2.10.95-0ubuntu2.8 [31.4 kB]
    default: Get:8 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 grub-pc amd64 2.02~beta2-36ubuntu3.16 [197 kB]
    default: Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 grub-pc-bin amd64 2.02~beta2-36ubuntu3.16 [889 kB]
    default: Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 grub2-common amd64 2.02~beta2-36ubuntu3.16 [510 kB]
    default: Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 grub-common amd64 2.02~beta2-36ubuntu3.16 [1,706 kB]
    default: Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapparmor-perl amd64 2.10.95-0ubuntu2.8 [31.4 kB]
    default: Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apparmor amd64 2.10.95-0ubuntu2.8 [450 kB]
    default: Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 parted amd64 3.2-15ubuntu0.1 [42.4 kB]
    default: Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libparted2 amd64 3.2-15ubuntu0.1 [115 kB]
    default: Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 sosreport amd64 3.5-1~ubuntu16.04.2 [121 kB]
    default: Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 cloud-guest-utils all 0.27-0ubuntu25 [15.2 kB]
    default: Preconfiguring packages ...
    default: Fetched 9,123 kB in 2s (3,873 kB/s)
    default: (Reading database ...
(Reading database ... 60%abase ... 5%
    default: (Reading database ... 65%
    default: (Reading database ... 70%
    default: (Reading database ... 75%
    default: (Reading database ... 80%
    default: (Reading database ... 85%
    default: (Reading database ... 90%
    default: (Reading database ... 95%
(Reading database ... 53985 files and directories currently installed.)
    default: Preparing to unpack .../systemd-sysv_229-4ubuntu21.1_amd64.deb ...
    default: Unpacking systemd-sysv (229-4ubuntu21.1) over (229-4ubuntu21) ...
    default: Processing triggers for man-db (2.7.5-1) ...
    default: Setting up systemd-sysv (229-4ubuntu21.1) ...
    default: (Reading database ...
(Reading database ... 60%abase ... 5%
    default: (Reading database ... 65%
    default: (Reading database ... 70%
    default: (Reading database ... 75%
    default: (Reading database ... 80%
    default: (Reading database ... 85%
    default: (Reading database ... 90%
    default: (Reading database ... 95%
(Reading database ... 53985 files and directories currently installed.)
    default: Preparing to unpack .../libpam-systemd_229-4ubuntu21.1_amd64.deb ...
    default: Unpacking libpam-systemd:amd64 (229-4ubuntu21.1) over (229-4ubuntu21) ...
    default: Preparing to unpack .../libsystemd0_229-4ubuntu21.1_amd64.deb ...
    default: Unpacking libsystemd0:amd64 (229-4ubuntu21.1) over (229-4ubuntu21) ...
    default: Processing triggers for man-db (2.7.5-1) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: Setting up libsystemd0:amd64 (229-4ubuntu21.1) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: (Reading database ...
(Reading database ... 30%abase ... 5%
(Reading database ... 60%abase ... 35%
    default: (Reading database ... 65%
    default: (Reading database ... 70%
    default: (Reading database ... 75%
    default: (Reading database ... 80%
    default: (Reading database ... 85%
    default: (Reading database ... 90%
    default: (Reading database ... 95%
(Reading database ... database ... 100%
    default: 53985 files and directories currently installed.)
    default: Preparing to unpack .../systemd_229-4ubuntu21.1_amd64.deb ...
    default: Unpacking systemd (229-4ubuntu21.1) over (229-4ubuntu21) ...
    default: Processing triggers for dbus (1.10.6-1ubuntu3.3) ...
    default: Processing triggers for ureadahead (0.100.0-19) ...
    default: Processing triggers for man-db (2.7.5-1) ...
    default: Setting up systemd (229-4ubuntu21.1) ...
    default: addgroup:
    default: The group `systemd-journal' already exists as a system group. Exiting.
    default: (Reading database ...
(Reading database ... 40%abase ... 5%
(Reading database ... 60%abase ... 45%
    default: (Reading database ... 65%
    default: (Reading database ... 70%
    default: (Reading database ... 75%
    default: (Reading database ... 80%
    default: (Reading database ... 85%
    default: (Reading database ... 90%
    default: (Reading database ... 95%
(Reading database ... 53985 files and directories currently installed.)
    default: Preparing to unpack .../udev_229-4ubuntu21.1_amd64.deb ...
    default: Unpacking udev (229-4ubuntu21.1) over (229-4ubuntu21) ...
    default: Preparing to unpack .../libudev1_229-4ubuntu21.1_amd64.deb ...
    default: Unpacking libudev1:amd64 (229-4ubuntu21.1) over (229-4ubuntu21) ...
    default: Processing triggers for systemd (229-4ubuntu21.1) ...
    default: Processing triggers for ureadahead (0.100.0-19) ...
    default: Processing triggers for man-db (2.7.5-1) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: Setting up libudev1:amd64 (229-4ubuntu21.1) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: (Reading database ...
(Reading database ... 50%abase ... 5%
(Reading database ... 60%abase ... 55%
    default: (Reading database ... 65%
    default: (Reading database ... 70%
    default: (Reading database ... 75%
    default: (Reading database ... 80%
    default: (Reading database ... 85%
    default: (Reading database ... 90%
    default: (Reading database ... 95%
(Reading database ... 53985 files and directories currently installed.)
    default: Preparing to unpack .../libapparmor1_2.10.95-0ubuntu2.8_amd64.deb ...
    default: Unpacking libapparmor1:amd64 (2.10.95-0ubuntu2.8) over (2.10.95-0ubuntu2.7) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: Setting up libapparmor1:amd64 (2.10.95-0ubuntu2.8) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: (Reading database ...
(Reading database ... 40%abase ... 5%
(Reading database ... 60%abase ... 45%
    default: (Reading database ... 65%
    default: (Reading database ... 70%
    default: (Reading database ... 75%
    default: (Reading database ... 80%
    default: (Reading database ... 85%
    default: (Reading database ... 90%
    default: (Reading database ... 95%
(Reading database ... 53985 files and directories currently installed.)
    default: Preparing to unpack .../grub-pc_2.02~beta2-36ubuntu3.16_amd64.deb ...
    default: Unpacking grub-pc (2.02~beta2-36ubuntu3.16) over (2.02~beta2-36ubuntu3.15) ...
    default: Preparing to unpack .../grub-pc-bin_2.02~beta2-36ubuntu3.16_amd64.deb ...
    default: Unpacking grub-pc-bin (2.02~beta2-36ubuntu3.16) over (2.02~beta2-36ubuntu3.15) ...
    default: Preparing to unpack .../grub2-common_2.02~beta2-36ubuntu3.16_amd64.deb ...
    default: Unpacking grub2-common (2.02~beta2-36ubuntu3.16) over (2.02~beta2-36ubuntu3.15) ...
    default: Preparing to unpack .../grub-common_2.02~beta2-36ubuntu3.16_amd64.deb ...
    default: Unpacking grub-common (2.02~beta2-36ubuntu3.16) over (2.02~beta2-36ubuntu3.15) ...
    default: Preparing to unpack .../libapparmor-perl_2.10.95-0ubuntu2.8_amd64.deb ...
    default: Unpacking libapparmor-perl (2.10.95-0ubuntu2.8) over (2.10.95-0ubuntu2.7) ...
    default: Preparing to unpack .../apparmor_2.10.95-0ubuntu2.8_amd64.deb ...
    default: Unpacking apparmor (2.10.95-0ubuntu2.8) over (2.10.95-0ubuntu2.7) ...
    default: Preparing to unpack .../parted_3.2-15ubuntu0.1_amd64.deb ...
    default: Unpacking parted (3.2-15ubuntu0.1) over (3.2-15) ...
    default: Preparing to unpack .../libparted2_3.2-15ubuntu0.1_amd64.deb ...
    default: Unpacking libparted2:amd64 (3.2-15ubuntu0.1) over (3.2-15) ...
    default: Preparing to unpack .../sosreport_3.5-1~ubuntu16.04.2_amd64.deb ...
    default: Unpacking sosreport (3.5-1~ubuntu16.04.2) over (3.4-1~ubuntu16.04.1) ...
    default: Preparing to unpack .../cloud-guest-utils_0.27-0ubuntu25_all.deb ...
    default: Unpacking cloud-guest-utils (0.27-0ubuntu25) over (0.27-0ubuntu24) ...
    default: Processing triggers for man-db (2.7.5-1) ...
    default: Processing triggers for install-info (6.1.0.dfsg.1-5) ...
    default: Processing triggers for systemd (229-4ubuntu21.1) ...
    default: Processing triggers for ureadahead (0.100.0-19) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: Setting up libpam-systemd:amd64 (229-4ubuntu21.1) ...
    default: Setting up udev (229-4ubuntu21.1) ...
    default: addgroup:
    default: The group `input' already exists as a system group. Exiting.
    default: update-initramfs: deferring update (trigger activated)
    default: Setting up grub-common (2.02~beta2-36ubuntu3.16) ...
    default: update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
    default: Setting up grub2-common (2.02~beta2-36ubuntu3.16) ...
    default: Setting up grub-pc-bin (2.02~beta2-36ubuntu3.16) ...
    default: Setting up grub-pc (2.02~beta2-36ubuntu3.16) ...
    default: Installing for i386-pc platform.
    default: Installation finished. No error reported.
    default: Generating grub configuration file ...
    default: Found linux image: /boot/vmlinuz-4.4.0-112-generic
    default: Found initrd image: /boot/initrd.img-4.4.0-112-generic
    default: done
    default: Setting up libapparmor-perl (2.10.95-0ubuntu2.8) ...
    default: Setting up apparmor (2.10.95-0ubuntu2.8) ...
    default: Installing new version of config file /etc/apparmor.d/tunables/kernelvars ...
    default: update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
    default: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
    default: Setting up libparted2:amd64 (3.2-15ubuntu0.1) ...
    default: Setting up parted (3.2-15ubuntu0.1) ...
    default: Setting up sosreport (3.5-1~ubuntu16.04.2) ...
    default: Setting up cloud-guest-utils (0.27-0ubuntu25) ...
    default: Processing triggers for initramfs-tools (0.122ubuntu8.10) ...
    default: update-initramfs: Generating /boot/initrd.img-4.4.0-112-generic
    default: W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: ** Initializing Firewall **
'   default: iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter
    default:
    default: Error occurred at line: 1
    default: Try `iptables-restore -h' or 'iptables-restore --help' for more information.
'   default: ip6tables-restore v1.6.0: ip6tables-restore: unable to initialize table 'filter
    default:
    default: Error occurred at line: 1
    default: Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
    default: E: Command line option 'y' [from -y] is not understood in combination with the other options.
    default: /usr/bin/env: ‘bash\r’: No such file or directory
    default: ** Install nginx **
    default: Reading package lists...
    default: Building dependency tree...
    default:
    default: Reading state information...
    default: The following additional packages will be installed:
    default:   fontconfig-config fonts-dejavu-core libapr1 libaprutil1 libfontconfig1
    default:   libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3 libxpm4 libxslt1.1
    default:   nginx-common nginx-core
    default: Suggested packages:
    default:   libgd-tools fcgiwrap nginx-doc ssl-cert
    default: The following NEW packages will be installed:
    default:   apache2-utils fontconfig-config fonts-dejavu-core libapr1 libaprutil1
    default:   libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libtiff5 libvpx3
    default:   libxpm4 libxslt1.1 nginx nginx-common nginx-core
    default: 0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
    default: Need to get 3,246 kB of archives.
    default: After this operation, 10.6 MB of additional disk space will be used.
    default: Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 libjpeg-turbo8 amd64 1.4.2-0ubuntu3 [111 kB]
    default: Get:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 libjbig0 amd64 2.1-3.1 [26.6 kB]
    default: Get:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 libapr1 amd64 1.5.2-3 [86.0 kB]
    default: Get:4 http://archive.ubuntu.com/ubuntu xenial/main amd64 libaprutil1 amd64 1.5.4-1build1 [77.1 kB]
    default: Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2-utils amd64 2.4.18-2ubuntu3.5 [82.3 kB]
    default: Get:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 fonts-dejavu-core all 2.35-1 [1,039 kB]
    default: Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 fontconfig-config all 2.11.94-0ubuntu1.1 [49.9 kB]
    default: Get:8 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libfontconfig1 amd64 2.11.94-0ubuntu1.1 [131 kB]
    default: Get:9 http://archive.ubuntu.com/ubuntu xenial/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2,194 B]
    default: Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libtiff5 amd64 4.0.6-1ubuntu0.2 [146 kB]
    default: Get:11 http://archive.ubuntu.com/ubuntu xenial/main amd64 libvpx3 amd64 1.5.0-2ubuntu1 [732 kB]
    default: Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libxpm4 amd64 1:3.5.11-1ubuntu0.16.04.1 [33.8 kB]
    default: Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgd3 amd64 2.1.1-4ubuntu0.16.04.8 [126 kB]
    default: Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libxslt1.1 amd64 1.1.28-2.1ubuntu0.1 [145 kB]
    default: Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 nginx-common all 1.10.3-0ubuntu0.16.04.2 [26.6 kB]
    default: Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 nginx-core amd64 1.10.3-0ubuntu0.16.04.2 [428 kB]
    default: Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 nginx all 1.10.3-0ubuntu0.16.04.2 [3,490 B]
    default: dpkg-preconfigure: unable to re-open stdin: No such file or directory
    default: Fetched 3,246 kB in 1s (2,077 kB/s)
    default: Selecting previously unselected package libjpeg-turbo8:amd64.
    default: (Reading database ...
(Reading database ... 60%abase ... 5%
    default: (Reading database ... 65%
    default: (Reading database ... 70%
    default: (Reading database ... 75%
    default: (Reading database ... 80%
(Reading database ... 90%abase ... 85%
    default: (Reading database ... 95%
(Reading database ... 53997 files and directories currently installed.)
    default: Preparing to unpack .../libjpeg-turbo8_1.4.2-0ubuntu3_amd64.deb ...
    default: Unpacking libjpeg-turbo8:amd64 (1.4.2-0ubuntu3) ...
    default: Selecting previously unselected package libjbig0:amd64.
    default: Preparing to unpack .../libjbig0_2.1-3.1_amd64.deb ...
    default: Unpacking libjbig0:amd64 (2.1-3.1) ...
    default: Selecting previously unselected package libapr1:amd64.
    default: Preparing to unpack .../libapr1_1.5.2-3_amd64.deb ...
    default: Unpacking libapr1:amd64 (1.5.2-3) ...
    default: Selecting previously unselected package libaprutil1:amd64.
    default: Preparing to unpack .../libaprutil1_1.5.4-1build1_amd64.deb ...
    default: Unpacking libaprutil1:amd64 (1.5.4-1build1) ...
    default: Selecting previously unselected package apache2-utils.
    default: Preparing to unpack .../apache2-utils_2.4.18-2ubuntu3.5_amd64.deb ...
    default: Unpacking apache2-utils (2.4.18-2ubuntu3.5) ...
    default: Selecting previously unselected package fonts-dejavu-core.
    default: Preparing to unpack .../fonts-dejavu-core_2.35-1_all.deb ...
    default: Unpacking fonts-dejavu-core (2.35-1) ...
    default: Selecting previously unselected package fontconfig-config.
    default: Preparing to unpack .../fontconfig-config_2.11.94-0ubuntu1.1_all.deb ...
    default: Unpacking fontconfig-config (2.11.94-0ubuntu1.1) ...
    default: Selecting previously unselected package libfontconfig1:amd64.
    default: Preparing to unpack .../libfontconfig1_2.11.94-0ubuntu1.1_amd64.deb ...
    default: Unpacking libfontconfig1:amd64 (2.11.94-0ubuntu1.1) ...
    default: Selecting previously unselected package libjpeg8:amd64.
    default: Preparing to unpack .../libjpeg8_8c-2ubuntu8_amd64.deb ...
    default: Unpacking libjpeg8:amd64 (8c-2ubuntu8) ...
    default: Selecting previously unselected package libtiff5:amd64.
    default: Preparing to unpack .../libtiff5_4.0.6-1ubuntu0.2_amd64.deb ...
    default: Unpacking libtiff5:amd64 (4.0.6-1ubuntu0.2) ...
    default: Selecting previously unselected package libvpx3:amd64.
    default: Preparing to unpack .../libvpx3_1.5.0-2ubuntu1_amd64.deb ...
    default: Unpacking libvpx3:amd64 (1.5.0-2ubuntu1) ...
    default: Selecting previously unselected package libxpm4:amd64.
    default: Preparing to unpack .../libxpm4_1%3a3.5.11-1ubuntu0.16.04.1_amd64.deb ...
    default: Unpacking libxpm4:amd64 (1:3.5.11-1ubuntu0.16.04.1) ...
    default: Selecting previously unselected package libgd3:amd64.
    default: Preparing to unpack .../libgd3_2.1.1-4ubuntu0.16.04.8_amd64.deb ...
    default: Unpacking libgd3:amd64 (2.1.1-4ubuntu0.16.04.8) ...
    default: Selecting previously unselected package libxslt1.1:amd64.
    default: Preparing to unpack .../libxslt1.1_1.1.28-2.1ubuntu0.1_amd64.deb ...
    default: Unpacking libxslt1.1:amd64 (1.1.28-2.1ubuntu0.1) ...
    default: Selecting previously unselected package nginx-common.
    default: Preparing to unpack .../nginx-common_1.10.3-0ubuntu0.16.04.2_all.deb ...
    default: Unpacking nginx-common (1.10.3-0ubuntu0.16.04.2) ...
    default: Selecting previously unselected package nginx-core.
    default: Preparing to unpack .../nginx-core_1.10.3-0ubuntu0.16.04.2_amd64.deb ...
    default: Unpacking nginx-core (1.10.3-0ubuntu0.16.04.2) ...
    default: Selecting previously unselected package nginx.
    default: Preparing to unpack .../nginx_1.10.3-0ubuntu0.16.04.2_all.deb ...
    default: Unpacking nginx (1.10.3-0ubuntu0.16.04.2) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: Processing triggers for man-db (2.7.5-1) ...
    default: Processing triggers for ureadahead (0.100.0-19) ...
    default: Processing triggers for ufw (0.35-0ubuntu2) ...
    default: Processing triggers for systemd (229-4ubuntu21.1) ...
    default: Setting up libjpeg-turbo8:amd64 (1.4.2-0ubuntu3) ...
    default: Setting up libjbig0:amd64 (2.1-3.1) ...
    default: Setting up libapr1:amd64 (1.5.2-3) ...
    default: Setting up libaprutil1:amd64 (1.5.4-1build1) ...
    default: Setting up apache2-utils (2.4.18-2ubuntu3.5) ...
    default: Setting up fonts-dejavu-core (2.35-1) ...
    default: Setting up fontconfig-config (2.11.94-0ubuntu1.1) ...
    default: Setting up libfontconfig1:amd64 (2.11.94-0ubuntu1.1) ...
    default: Setting up libjpeg8:amd64 (8c-2ubuntu8) ...
    default: Setting up libtiff5:amd64 (4.0.6-1ubuntu0.2) ...
    default: Setting up libvpx3:amd64 (1.5.0-2ubuntu1) ...
    default: Setting up libxpm4:amd64 (1:3.5.11-1ubuntu0.16.04.1) ...
    default: Setting up libgd3:amd64 (2.1.1-4ubuntu0.16.04.8) ...
    default: Setting up libxslt1.1:amd64 (1.1.28-2.1ubuntu0.1) ...
    default: Setting up nginx-common (1.10.3-0ubuntu0.16.04.2) ...
    default: Setting up nginx-core (1.10.3-0ubuntu0.16.04.2) ...
    default: Setting up nginx (1.10.3-0ubuntu0.16.04.2) ...
    default: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    default: Processing triggers for systemd (229-4ubuntu21.1) ...
    default: Processing triggers for ureadahead (0.100.0-19) ...
    default: Processing triggers for ufw (0.35-0ubuntu2) ...
    default: Adding password for user kibanaadmin

C:\tmp\screeps-stats>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/xenial64' is up to date...
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

C:\tmp\screeps-stats>vagrant provision
==> default: Running provisioner: shell...
    default: Running: C:/Users/Bela/AppData/Local/Temp/vagrant-shell20180209-6612-774v4o.sh
    default: ** Adding Apt Mirrors **
    default: ** Disabling IPv6 **
    default: #disable ipv6
    default: net.ipv6.conf.all.disable_ipv6 = 1
    default: net.ipv6.conf.default.disable_ipv6 = 1
    default: net.ipv6.conf.lo.disable_ipv6 = 1
    default: net.ipv6.conf.all.disable_ipv6 = 1
    default: net.ipv6.conf.default.disable_ipv6 = 1
    default: net.ipv6.conf.lo.disable_ipv6 = 1
    default: net.ipv6.conf.all.disable_ipv6 = 1
    default: net.ipv6.conf.default.disable_ipv6 = 1
    default: net.ipv6.conf.lo.disable_ipv6 = 1
    default: ** Upgrade System **
    default: Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
    default: Hit:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
    default: Hit:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
    default: Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
    default: Reading package lists...
    default: Reading package lists...
    default: Building dependency tree...
    default:
    default: Reading state information...
    default: Calculating upgrade...
    default: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    default: ** Initializing Firewall **
    default: mkdir: cannot create directory ‘/etc/iptables’
    default: : File exists
'   default: iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter
    default:
    default: Error occurred at line: 1
    default: Try `iptables-restore -h' or 'iptables-restore --help' for more information.
'   default: ip6tables-restore v1.6.0: ip6tables-restore: unable to initialize table 'filter
    default:
    default: Error occurred at line: 1
    default: Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
    default: E: Command line option 'y' [from -y] is not understood in combination with the other options.
    default: /usr/bin/env: ‘bash\r’
    default: : No such file or directory
    default: ** Install nginx **
    default: Reading package lists...
    default: Building dependency tree...
    default:
    default: Reading state information...
    default: apache2-utils is already the newest version (2.4.18-2ubuntu3.5).
    default: nginx is already the newest version (1.10.3-0ubuntu0.16.04.2).
    default: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    default: Adding
    default: password for user kibanaadmin


C:\tmp\screeps-stats>vagrant --version
Vagrant 2.0.2

Re-authorization not done after a server restart.

Was reported in the slack channel.

Regards,
Dissi

7/11/2016 4:17:17 AM self.run()
7/11/2016 4:17:17 AM File "/screeps-stats/screeps_etl/memorystats.py", line 35, in run
7/11/2016 4:17:17 AM screeps = self.getScreepsAPI()
7/11/2016 4:17:17 AM File "/screeps-stats/screeps_etl/memorystats.py", line 25, in getScreepsAPI
7/11/2016 4:17:17 AM self.api = screepsapi.API(u=settings['screeps_username'],p=settings['screeps_password'],ptr=settings['screeps_ptr'])
7/11/2016 4:17:17 AM File "/screeps-stats/src/screepsapi/screepsapi/screepsapi.py", line 38, in __init

7/11/2016 4:17:17 AM self.token = self.post('auth/signin', email=u, password=p)['token']
7/11/2016 4:17:17 AMKeyError: 'token'
7/11/2016 4:17:18 AMProcess APIProcess-401:
7/11/2016 4:17:18 AMTraceback (most recent call last):

Private Server

Are there plans to support private servers with screeps-stats? Or is screeps-grafana the only current option available for private servers?

Removing code results in "ReferenceError: Stats is not defined"

I commenting out

// var ScreepsStats = require('screepsstats')
// global.Stats = new ScreepsStats()

and

//  Stats.runBuiltinStats()

which results in this error every tick

_console1466737246270_0:1
Stats.removeTick(["11413454","11413453"]);
^
ReferenceError: Stats is not defined

So I guess this has to do with some sort of internal global caching.
After waiting for a few minutes hoping for this to sort themselves out, I still get the error, I also tried things like setting global.Stats = undefined but didn't have any luck with that either.

Anyone have an idea of whats going on with this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.