A swift network profiler built on top of URLSession.

Overview

Platform iOS Swift 4 compatible Carthage compatible CocoaPods compatible License: MIT

By Xmartlabs SRL.

Introduction

Xniffer is a non-intrusive framework for intercepting outgoing requests and their responses between your app and any external service for debugging and performance monitoring purposes.

Inspired by Response detective.

Setup

In order to work, the Xniffer needs to be added as a middleware between your URLSession and the Internet. After the initial setup, a window will be displayed on top of the UI that will show all the current requests and their latency.

Basic usage

let configuration = URLSessionConfiguration.default
// The setup method adds the Xniffer's custom protocol as a middleware.
Xniffer.setup(with: configuration)
let session = URLSession(configuration: configuration)

Now we can start using this session instance for our requests!

Using Alamofire

If you are using Alamofire you can start using the Xniffer by initializing your Manager with the following:

let configuration = URLSessionConfiguration.default
configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders
Xniffer.setup(with: configuration)
let sessionManager = Alamofire.SessionManager(configuration: configuration)

UI Modes

The Xniffer currently supports three modes which could be used at the same time, .window, .console and .custom. The default value is only.window but this can be changed easily on the Xniffer.setup(configuration: URLSessionConfiguration, modes: [XnifferUI] = [.window]).

Each one of this uses a different implementation of the XnifferObserver.

  • .window : Displays a window on top of the status bar which can be expanded to display a list of the profiled requests. This is the default value.
  • .console : Prints the results on the Xcode console.
  • .custom : This one receives a closure of type () -> () so you can use your own implementation of the XnifferObserver.

Requirements

  • iOS 9.0+
  • Xcode 9.0+

Getting involved

  • If you want to contribute please feel free to submit pull requests.
  • If you have a feature request please open an issue.
  • If you found a bug or need help please check older issues, FAQ and threads on StackOverflow (Tag 'Xniffer') before submitting an issue..

Before contribute check the CONTRIBUTING file for more info.

If you use Xniffer in your app We would love to hear about it! Drop us a line on twitter.

Examples

Follow these 3 steps to run Example project: Clone Xniffer repository, open Xniffer workspace and run the Example project.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

To install Xniffer, simply add the following line to your Podfile:

pod 'Xniffer', '~> 3.0'

Carthage

Carthage is a simple, decentralized dependency manager for Cocoa.

To install Xniffer, simply add the following line to your Cartfile:

github "xmartlabs/Xniffer" ~> 3.0

Author

Change Log

This can be found in the CHANGELOG.md file.

You might also like...
Profiler Application using Sentiment Analysis

Profiler Application using Sentiment Analysis Abstract We send many posts and pictures over the time on our social channels such as Facebook, Instagra

Write clean, concise and declarative network code relying on URLSession, with the power of RxSwift. Inspired by Retrofit.

ReactiveAPI Reactive API library allows you to write clean, concise and declarative network code, with the power of RxSwift and URLSession! iOS Demo A

Allows users to pull in new song releases from their favorite artists and provides users with important metrics like their top tracks, top artists, and recently played tracks, queryable by time range.

Spotify Radar Spotify Radar is an iOS application that allows users to pull in new song releases from their favorite artists and provides users with i

🤵🏽‍♀️ Janet — A thin HTTP networking layer built on URLSession for simple, declarative endpoint specification leveraging the power of async/await.

🤵🏽‍♀️ Janet — Just another networking kit — A thin HTTP networking layer built on URLSession for simple, declarative endpoint specification leveragi

Lightweight network abstraction layer, written on top of Alamofire
Lightweight network abstraction layer, written on top of Alamofire

TRON is a lightweight network abstraction layer, built on top of Alamofire. It can be used to dramatically simplify interacting with RESTful JSON web-

Network debugging made easy,This network debugging tool is developed based on the swift version of Wormholy.
Network debugging made easy,This network debugging tool is developed based on the swift version of Wormholy.

Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable. What you can do: No code to write an

NWReachability - a pure Swift library for monitoring the network connection of iOS devices using Apple's Network framework.

NWReachability is a pure Swift library for monitoring the network connection of iOS devices using Apple's Network framework.

API-TableView-Swift - API call with URLSession and show data to TableView with swift
API-TableView-Swift - API call with URLSession and show data to TableView with swift

API-TableView-Swift API call with URLSession and show data to TableView with swi

 Zip - A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip.
Zip - A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip.

Zip A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip. Usage Import Zip at the top of the Swift file

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!

OHHTTPStubs OHHTTPStubs is a library designed to stub your network requests very easily. It can help you: test your apps with fake network data (stubb

A network extension app to block a user input URI. Meant as a network extension filter proof of concept.
A network extension app to block a user input URI. Meant as a network extension filter proof of concept.

URIBlockNE A network extension app to block a user input URI. Meant as a network extension filter proof of concept. This is just a research effort to

Say goodbye to the Fat ugly singleton Network Manager with this Network Layer

MHNetwork Protocol Oriented Network Layer Aim to avoid having bloated singleton NetworkManager Philosophy the main philosophy behind MHNetwork is to h

Easy and lightweight network layer for creating different set of network requests like GET, POST, PUT, DELETE customizable with coders conforming to TopLevelDecoder, TopLevelEncoder
Easy and lightweight network layer for creating different set of network requests like GET, POST, PUT, DELETE customizable with coders conforming to TopLevelDecoder, TopLevelEncoder

Easy and lightweight network layer for creating different set of network requests like GET, POST, PUT, DELETE customizable with coders conforming to TopLevelDecoder, TopLevelEncoder

Developed with use Swift language. As a third party library used SDWebImage. JSON parsing using URLSession with TMDB API. This app provide by the Core Data structure.

Capstone Project 🎯 About Developed with use Swift language. As a third party library used SDWebImage. JSON parsing using URLSession with TMDB API. Ad

Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).

Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD). It allows you to create any asynchronous and synchronous task easily, all managed by a queue, with just a few lines.

 Reactive extensions to Cocoa frameworks, built on top of ReactiveSwift.
Reactive extensions to Cocoa frameworks, built on top of ReactiveSwift.

ReactiveSwift offers composable, declarative and flexible primitives that are built around the grand concept of streams of values over time. These primitives can be used to uniformly represent common Cocoa and generic programming patterns that are fundamentally an act of observation.

iOS Simulator type agnostic snapshot testing, built on top of the FBSnapshotTestCase.
iOS Simulator type agnostic snapshot testing, built on top of the FBSnapshotTestCase.

SnappyTestCase iOS Simulator type agnostic snapshot testing, built on top of the FBSnapshotTestCase. Why? Snapshot testing helps to deliver views that

Forecast App is an ios application built on top of omdb movie api for batman lovers to see their favorite batman movies
Forecast App is an ios application built on top of omdb movie api for batman lovers to see their favorite batman movies

Catbon-Movie-App Forecast App is an ios application built on top of omdb movie api for batman lovers to see their favorite batman movies, users can al

 InsuranceCostsPrediction an example app built on top of SwiftUI
InsuranceCostsPrediction an example app built on top of SwiftUI

This is an example app built on top of SwiftUI. The app allows the user to estimated amount of $ to pay for the insurance costs based on some feature, such as: sex, age, child, smoke, bmi.

Comments
  • Could not load NIB in bundle

    Could not load NIB in bundle

    Nice framework! But when using it via pod. Crashed. It reported that:

    Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users//Library/Developer/CoreSimulator/Devices/D7ED7C3A-3933-4F70-B951-CD5446737CF3/data/Containers/Bundle/Application/CB81BB7A-2841-4C0E-ABFA-E540034A183C/pangu.app/Frameworks/Xniffer.framework> (loaded)' with name 'ResultCell''

    opened by jkyeo 2
  • Added multiple mode support

    Added multiple mode support

    Fixes #issue(s) . #14 #8 Changes proposed in this request:

    • Added default label on window to display when no request are made.
    • Added support for multiple modes.
    opened by mcousillas6 0
  • Updated properties access level.

    Updated properties access level.

    Updated access levels to Xniffer properties to enable setting the delegate from outside of the class. Now you can set a custom delegate using the callback provided in the .custom mode as initially intended.

    Fixes #issue(s) . #5

    opened by mcousillas6 0
  • Fixed crash while loading ResultCell

    Fixed crash while loading ResultCell

    Fixes #3

    Changes proposed in this request:

    • Removed usage of resource_bundles on the podspec. Now all file path are set on source_files. This fixes the issue of the ResultCell's xib not being found.
    bug 
    opened by mcousillas6 0
Releases(3.0.0)
Owner
xmartlabs
xmartlabs
Customizable Console UI overlay with debug log on top of your iOS App

AEConsole Customizable Console UI overlay with debug log on top of your iOS App AEConsole is built on top of AELog, so you should probably see that fi

Marko Tadić 142 Dec 21, 2022
Automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code based on Swift. Just like God opened his eyes

GodEye Automaticly display Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code based on Swift. Just like God opened hi

陈奕龙(子循) 3.7k Dec 23, 2022
A lightweight, one line setup, iOS / OSX network debugging library! 🦊

Netfox provides a quick look on all executed network requests performed by your iOS or OSX app. It grabs all requests - of course yours, requests from

Christos Kasketis 3.4k Dec 28, 2022
Remote network and data debugging for your native iOS app using Chrome Developer Tools

PonyDebugger PonyDebugger is a remote debugging toolset. It is a client library and gateway server combination that uses Chrome Developer Tools on you

Square 5.9k Dec 24, 2022
a iOS network debug library, monitor HTTP requests

NetworkEye README 中文 NetworkEye,a iOS network debug library,monitor HTTP requests. It can be detected HTTP request include web pages, NSURLConnection,

coderyi 1.4k Dec 31, 2022
iOS network debugging, like a wizard 🧙‍♂️

Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable. What you can do: No code to write an

Paolo Musolino 2.1k Jan 8, 2023
Profiling / Debugging assist tools for iOS. (Memory Leak, OOM, ANR, Hard Stalling, Network, OpenGL, Time Profile ...)

MTHawkeye Readme 中文版本 MTHawkeye is profiling, debugging tools for iOS used in Meitu. It's designed to help iOS developers improve development producti

meitu 1.4k Dec 29, 2022
SwiftHooks is a little module for plugins, in Swift

A Hook represents a "pluggable" point in a software model. They provide a mechanism for "tapping" into such points to get updates, or apply additional functionality to some typed object.

Intuit 7 Dec 21, 2022
Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application.

Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application. Install Carthage

Ronan Rodrigo Nunes 89 Dec 26, 2022
Coz profiler Swift wrapper/bindings

Swift Coz (Linux Only) Coz profiler Swift wrapper/bindings. This is a Swift wrapper around the Coz profiler here: https://github.com/plasma-umass/coz

Krzysztof Majk 4 Aug 5, 2022