FLogging: Metric Collection on the High Seas Joe Ludwig Director of Development Flying Lab Software.

Slides:



Advertisements
Similar presentations
PHP: Date() Function The PHP date() function formats a timestamp to a more readable date and time.
Advertisements

Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
Relational Algebra, Join and QBE Yong Choi School of Business CSUB, Bakersfield.
Transact-SQL. 1. Declare float = 10 select * from customers where discnt
1Key – Report Creation with DB2. DB2 Databases Create Domain for DB2 Test Demo.
2010/11 : [1]Building Web Applications using MySQL and PHP (W1)MySQL Recap.
Day 3 - Basics of MySQL What is MySQL What is MySQL How to make basic tables How to make basic tables Simple MySQL commands. Simple MySQL commands.
Chapter 4B: More Advanced PL/SQL Programming
1004INT Information Systems Week 10 Databases as Business Tools.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Denny Cherry twitter.com/mrdenny.
1 CS428 Web Engineering Lecture 23 MySQL Basics (PHP - VI)
Create Forms Lesson 5. Software Orientation Creating Forms A form is a database object –enter, edit, or display data from a table or query Providing.
CPSC 203 Introduction to Computers Lab 21, 22 By Jie (Jeff) Gao.
From VS C# 2010 Programming, John Allwork 1 VS2010 C# Programming - DB intro 1 Topics – Database Relational - linked tables SQL ADO.NET objects Referencing.
IMS 4212: Application Architecture and Intro to Stored Procedures 1 Dr. Lawrence West, Management Dept., University of Central Florida
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Selene Bainum RiteTech LLC.  Doing ColdFusion & SQL development for more than 1/3 of my lifetime  Chief RiteTech  RiteTech is my company.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
Dexterity | CONFIDENTIAL 2009 MRO | Analytics | Insights 1 Stored Procedures.
1 Access for non-experts Link tables Find fields Criteria Join tables Find missing comment lines Understand relational databases (Wow!)
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
1 Working with MS SQL Server Textbook Chapter 14.
1 Definition of a subquery Nested subqueries Correlated subqueries The ISNULL function Derived tables The EXISTS operator Mixing data types: CAST & CONVERT.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
Introduction to MySQL Lab no. 10 Advance Database Management System.
Database and mySQL Week 07 Dynamic Web TCNJ Jean Chu.
SQL Data Definition Language (DDL) Using Microsoft SQL Server 1SDL Data Definition Language (DDL)
Data Management Console Synonym Editor
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
A Brief Documentation.  Provides basic information about connection, server, and client.
SQL Injection Jason Dunn. SQL Overview Structured Query Language For use with Databases Purpose is to retrieve information Main Statements Select Insert.
ADO.NET Part 2. Slide 2 Overview Slide 3 Introduction to the DataGridView Control It’s a two-dimensional grid containing rows and columns Its use in.
Module 8: Implementing Stored Procedures. Overview Implementing Stored Procedures Creating Parameterized Stored Procedures Working With Execution Plans.
What have we learned?. What is a database? An organized collection of related data.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
Module 3 Designing and Implementing Tables. Module Overview Designing Tables Working with Schemas Creating and Altering Tables.
What’s a database? Data stored in a structured format that lends itself to easy manipulation and recall.
Course FAQ’s I do not have any knowledge on SQL concepts or Database Testing. Will this course helps me to get through all the concepts? What kind of.
SQL Server 2005 Implementation and Maintenance Chapter 3: Tables and Views.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
CPSC 203 Introduction to Computers Lab 60 By Jie Gao.
SQL SERVER DAYS 2011 Table Indexing for the.NET Developer Denny Cherry twitter.com/mrdenny.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
Relational Databases: Basic Concepts BCHB Lecture 21 By Edwards & Li Slides:
Task #1 Create a relational database on computers in computer classroom 308, using MySQL server and any client. Create the same database, using MS Access.
Session 1 Module 1: Introduction to Data Integrity
IBuySPY Shopping Store. Data Model for IBuySPY Shopping Store.
CPSC 203 Introduction to Computers Lab 21 By Jie Gao.
Slide 1 Chapter 7 – Part 3 Stored Procedure, Function &Trigger.
IMS 4212: Application Architecture and Intro to Stored Procedures 1 Dr. Lawrence West, Management Dept., University of Central Florida
Confidencial - TRACASA Automatize test [e- Reporting]
Creating E/R Diagrams with SQL Server Management Studio, Writing SQL Queries D0ncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
CS422 Principles of Database Systems Stored Procedures and Triggers Chengyu Sun California State University, Los Angeles.
FLOW OF OPERATIONS. Choose output size Choose output format Correct data types Add/Remove columns Change data types Set bindings Use functions Adjust.
 MySQL is a database system used on the web  MySQL is a database system that runs on a server  MySQL is ideal for both small and large applications.
Understanding Core Database Concepts Lesson 1. Objectives.
Task oriented processing
PROCEDURES, CONDITIONAL LOGIC, EXCEPTION HANDLING, TRIGGERS
Overview Implementing Triggers Implementing XML Schemas.
SQL Code for Byrnetube video
Introduction To Structured Query Language (SQL)
Introduction To Structured Query Language (SQL)
CodePainter Revolution Trainer Course
Understanding Core Database Concepts
Introduction to SQL Server and the Structure Query Language
Presentation transcript:

FLogging: Metric Collection on the High Seas Joe Ludwig Director of Development Flying Lab Software

What is FLogging?  Server-side  Metric collection  Game events with parameters  Server performance events

Formal + Log = FLog

Design Goals  Designer goals  Lots of different views on data  Possible to derive context from data  Programmer goals  Easy to add new flog types  No global recompiles

Data Collection

Adding a new flog type  Add any new field types in XML  Add the new flog type in XML  Upgrade database to generate SQL  Tables  Procedures  Views  Add call to record flog

Flog types defined in XML Flogger_field_types.xml: level TINYINT

Flog types defined in XML Flogger_types.xml: level_gained level true false

Add call to record flog void flsAdvancementManager::setLevel(flsCharacter* pCharacter, igChar iNewLevel) { pCharacter->assignNewLevel(iNewLevel); if(pCharacter->isPlayer()) { flsFlogger::flogf("level_gained", pCharacter->getLocalId(), "%d", iNewLevel); }

Database Format - Tables  Flog table – one entry per flog  Value tables – One entry per flog that uses that field type  Flog_type table – One entry per type

flog table FieldType IdBIGINT IDENTITY Flog_typeINT Flog_timeDATETIME Cluster_idINT Character_idINT PuidBIGINT

value table FieldType IdBIGINT ValueTINYINT Type of value column is controlled by flogger_field_types.xml

flog_type table FieldType Flog_typeINT NameCHAR(32) hideByDefaultTINYINT

Database Format – Stored Procedures  Flog type procedures  Flog type expiration procedures  Flog_heartbeat procedure

Flog type procedures CREATE PROCEDURE TINYINT AS BEGIN int; = = clusterid FROM #flog_vars; INSERT INTO flog (puid, cluster_id, flog_type, object_id) BIGINT; = SCOPE_IDENTITY(); INSERT INTO flog_level (id, value) END

Flog age procedures CREATE PROCEDURE Flog_Age_skill_used AS DELETE flog FROM flog, flog_item_id WHERE DATEDIFF(DAY, flog.flog_time, CURRENT_TIMESTAMP)>=2 AND flog.id=flog_item_id.id

Flog Heartbeat procedure CREATE PROCEDURE Flog_Maintenance AS BEGIN EXEC flog_Age_maneuver_skill_used; EXEC flog_Age_skill_used; EXEC flog_Age_volley_fired; END

Database Format – Type View CREATE VIEW Flog_Data_level_gained AS SELECT flog.id, flog_level.value AS [level] FROM flog INNER JOIN flog_level ON flog.id=flog_level.id WHERE flog.flog_type=3

What we flog  Login/Logout events  Zoning  Economic events  Advancement events  Missions  Conquest events  Chat  GM commands

How much data?  4.5 million new flog records per week  Top 5 flog types account for 50%

Example flog output

Money Gained ReasonAmount money_gained_mission31,310,500 money_gained_trade11,038,331 money_gained_kill8,029,993 money_gained_auction6,826,344 money_gained_shop4,123,899 money_gained_create_society13,000 money_gained_respec1,263 money_gained_mail350

Money Lost ReasonAmount money_lost_trade11,038,331 money_lost_recipe10,980,920 money_lost_auction9,956,249 money_lost_shop7,587,867 money_lost_ActivateStructureDeed4,760,800 money_lost_admin3,338,500 money_lost_recipe_tax633,113 money_lost_PayStructureUpkeep510,225 money_lost_auction_listing_fee159,867 money_lost_create_society89,000 money_lost_mail14,550 money_lost_AuctionRelist1,566

Exploit Detection

Reports using context  Context is available in the data  Extracting it can be slow  Example: Deaths per level

Current level function CREATE FUNCTION level_at_flog BIGINT) RETURNS INT AS BEGIN INT SELECT TOP = flog_level.value FROM flog INNER JOIN flog_level ON flog.id=flog_level.id WHERE (flog.id AND AND flog.cluster_id AND flog.flog_type=3 ORDER BY flog.id DESC IS NULL END

Death by level table CREATE TABLE death_by_level (id BIGINT, level INT, object_id INT, cluster_id INT)

Death by level table INSERT INTO death_by_level (id, level, object_id, cluster_id) SELECT flog.id, dbo.level_at_flog(flog.object_id, flog.cluster_id, flog.id) AS [Level], flog.object_id, flog.cluster_id FROM flog WHERE flog.flog_type=65

Death by level table idLevelobject_idcluster_id

Death by level report SELECT level, COUNT(id) AS [Deaths] FROM death_by_level GROUP BY level ORDER BY level

More data from context  Death by zone  Death by mission  XP by zone  Skills purchased by level  Play time per level

Room to improve  More and better reports  Automatic data rollups  Parameterized queries  Multiple associated fields in one table  Performance

Questions? Slides available at Joe Ludwig